{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "8f97fba2",
   "metadata": {},
   "source": [
    "# Graph Instruction数据集重处理\n",
    "\n",
    "根据针对不同graph task-specific任务进行处理后得到的instruction数据集，进行重处理，主要涉及如下几个环节：\n",
    "- 数据质量抽样调查；\n",
    "- 数据分布统计；\n",
    "- 分词（tokenizer）检测与长度检测；\n",
    "- 测试集采样"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "d4d4a53d",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import json\n",
    "import numpy as np\n",
    "from tqdm import tqdm\n",
    "from random import shuffle\n",
    "import random"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "a08a71cc",
   "metadata": {},
   "outputs": [],
   "source": [
    "instruction_data_dir = \"./instruction_dataset/\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "1ea9e5d5",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|███████████████████████████████████████████| 37/37 [01:58<00:00,  3.19s/it]\n"
     ]
    }
   ],
   "source": [
    "instruction_train_data = list() # regular-scale\n",
    "instruction_test_data = list()\n",
    "instruction_train_data_small = list() # small-scale\n",
    "instruction_test_data_small = list() # small-scale\n",
    "test_data_num = 0\n",
    "for data_file in tqdm(os.listdir(instruction_data_dir)):\n",
    "    if data_file in [\".DS_Store\", \"released\", \"instruction_train_data_forcot.npy\", \"instruction_train_data_forcot_2.npy\"]:\n",
    "        continue\n",
    "    data = np.load(os.path.join(instruction_data_dir, data_file), allow_pickle=True)[()]\n",
    "    for task_name, task_data in data.items():\n",
    "        task_train_data, task_test_data = task_data[\"train\"], task_data[\"test\"]\n",
    "        instruction_train_data.extend(task_train_data)\n",
    "        instruction_test_data.extend(task_test_data)\n",
    "        test_data_num += len(task_test_data)\n",
    "        \n",
    "        shuffle(task_train_data)\n",
    "        shuffle(task_test_data)\n",
    "        task_train_data = task_train_data[:int(0.1 * len(task_train_data))]\n",
    "        task_test_data = task_test_data[:int(0.1 * len(task_test_data))]\n",
    "        instruction_train_data_small.extend(task_train_data)\n",
    "        instruction_test_data_small.extend(task_test_data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "ca3c519f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "instruction train data num:  1603436\n",
      "instruction test data num:  50169\n",
      "instruction train data small num:  160335\n",
      "instruction test data small num:  5007\n"
     ]
    }
   ],
   "source": [
    "print(\"instruction train data num: \", len(instruction_train_data))\n",
    "print(\"instruction test data num: \", test_data_num)\n",
    "print(\"instruction train data small num: \", len(instruction_train_data_small))\n",
    "print(\"instruction test data small num: \", len(instruction_test_data_small))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "370f8af2",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "23a99803",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'task_name': 'graph-language-modeling-graph-question-answering-webquestions',\n",
       " 'idx': 19,\n",
       " 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'Dr. Lawrence Angelo\\', \\'The Elder Brother\\', \\'Fabian\\', \\'Archy Stallings\\', \\'Old Man Willow\\', \\'Edgar Derby\\', \\'Male\\', \\'Simon Phoenix\\', \\'Brian Chavez\\', \\'Matter-Eater Lad\\', \\'Buddy Walling\\', \\'Peter Hines\\', \\'Zeus\\', \\'Trevor West\\', \\'Ogden Morrow\\', \\'Aegeus\\', \\'Ted\\', \\'Local Man\\', \\'Cura\\', \\'Tomohisa Kaname\\', \\'Priest A\\', \\'Alexander Kaseph\\', \\'Alfred Bellows\\', \\'Tarble\\', \\'Jewish Official\\', \\'Spirit\\', \\'Policeman Fire\\'];\\n    triple_list = [(\"Male\" -> \"Tarble\")[relation=\"characters of this gender\"], (\"Male\" -> \"Ted\")[relation=\"characters of this gender\"], (\"Male\" -> \"Brian Chavez\")[relation=\"characters of this gender\"], (\"Male\" -> \"Dr. Lawrence Angelo\")[relation=\"characters of this gender\"], (\"Male\" -> \"Tomohisa Kaname\")[relation=\"characters of this gender\"], (\"Male\" -> \"Policeman Fire\")[relation=\"characters of this gender\"], (\"Male\" -> \"Ogden Morrow\")[relation=\"characters of this gender\"], (\"Male\" -> \"Alexander Kaseph\")[relation=\"characters of this gender\"], (\"Male\" -> \"Local Man\")[relation=\"characters of this gender\"], (\"Male\" -> \"Fabian\")[relation=\"characters of this gender\"], (\"Male\" -> \"Peter Hines\")[relation=\"characters of this gender\"], (\"Male\" -> \"Simon Phoenix\")[relation=\"characters of this gender\"], (\"Male\" -> \"Cura\")[relation=\"characters of this gender\"], (\"Male\" -> \"Buddy Walling\")[relation=\"characters of this gender\"], (\"Male\" -> \"Spirit\")[relation=\"characters of this gender\"], (\"Male\" -> \"Zeus\")[relation=\"characters of this gender\"], (\"Male\" -> \"Old Man Willow\")[relation=\"characters of this gender\"], (\"Male\" -> \"Alfred Bellows\")[relation=\"characters of this gender\"], (\"Male\" -> \"Edgar Derby\")[relation=\"characters of this gender\"], (\"Male\" -> \"The Elder Brother\")[relation=\"characters of this gender\"], (\"Male\" -> \"Matter-Eater Lad\")[relation=\"characters of this gender\"], (\"Male\" -> \"Trevor West\")[relation=\"characters of this gender\"], (\"Male\" -> \"Jewish Official\")[relation=\"characters of this gender\"], (\"Male\" -> \"Priest A\")[relation=\"characters of this gender\"], (\"Male\" -> \"Archy Stallings\")[relation=\"characters of this gender\"], (\"Male\" -> \"Aegeus\")[relation=\"characters of this gender\"]];\\n}\\n```\\nTask definition: given a question and a corresponding knowledge graph, and find an entity in the graph and answer the question.\\nQ: what is cher \\'s son \\'s name ?\\nA:',\n",
       " 'graph_language': '```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'Dr. Lawrence Angelo\\', \\'The Elder Brother\\', \\'Fabian\\', \\'Archy Stallings\\', \\'Old Man Willow\\', \\'Edgar Derby\\', \\'Male\\', \\'Simon Phoenix\\', \\'Brian Chavez\\', \\'Matter-Eater Lad\\', \\'Buddy Walling\\', \\'Peter Hines\\', \\'Zeus\\', \\'Trevor West\\', \\'Ogden Morrow\\', \\'Aegeus\\', \\'Ted\\', \\'Local Man\\', \\'Cura\\', \\'Tomohisa Kaname\\', \\'Priest A\\', \\'Alexander Kaseph\\', \\'Alfred Bellows\\', \\'Tarble\\', \\'Jewish Official\\', \\'Spirit\\', \\'Policeman Fire\\'];\\n    triple_list = [(\"Male\" -> \"Tarble\")[relation=\"characters of this gender\"], (\"Male\" -> \"Ted\")[relation=\"characters of this gender\"], (\"Male\" -> \"Brian Chavez\")[relation=\"characters of this gender\"], (\"Male\" -> \"Dr. Lawrence Angelo\")[relation=\"characters of this gender\"], (\"Male\" -> \"Tomohisa Kaname\")[relation=\"characters of this gender\"], (\"Male\" -> \"Policeman Fire\")[relation=\"characters of this gender\"], (\"Male\" -> \"Ogden Morrow\")[relation=\"characters of this gender\"], (\"Male\" -> \"Alexander Kaseph\")[relation=\"characters of this gender\"], (\"Male\" -> \"Local Man\")[relation=\"characters of this gender\"], (\"Male\" -> \"Fabian\")[relation=\"characters of this gender\"], (\"Male\" -> \"Peter Hines\")[relation=\"characters of this gender\"], (\"Male\" -> \"Simon Phoenix\")[relation=\"characters of this gender\"], (\"Male\" -> \"Cura\")[relation=\"characters of this gender\"], (\"Male\" -> \"Buddy Walling\")[relation=\"characters of this gender\"], (\"Male\" -> \"Spirit\")[relation=\"characters of this gender\"], (\"Male\" -> \"Zeus\")[relation=\"characters of this gender\"], (\"Male\" -> \"Old Man Willow\")[relation=\"characters of this gender\"], (\"Male\" -> \"Alfred Bellows\")[relation=\"characters of this gender\"], (\"Male\" -> \"Edgar Derby\")[relation=\"characters of this gender\"], (\"Male\" -> \"The Elder Brother\")[relation=\"characters of this gender\"], (\"Male\" -> \"Matter-Eater Lad\")[relation=\"characters of this gender\"], (\"Male\" -> \"Trevor West\")[relation=\"characters of this gender\"], (\"Male\" -> \"Jewish Official\")[relation=\"characters of this gender\"], (\"Male\" -> \"Priest A\")[relation=\"characters of this gender\"], (\"Male\" -> \"Archy Stallings\")[relation=\"characters of this gender\"], (\"Male\" -> \"Aegeus\")[relation=\"characters of this gender\"]];\\n}\\n```',\n",
       " 'graph': {'node_list': ['Dr. Lawrence Angelo',\n",
       "   'The Elder Brother',\n",
       "   'Fabian',\n",
       "   'Archy Stallings',\n",
       "   'Old Man Willow',\n",
       "   'Edgar Derby',\n",
       "   'Male',\n",
       "   'Simon Phoenix',\n",
       "   'Brian Chavez',\n",
       "   'Matter-Eater Lad',\n",
       "   'Buddy Walling',\n",
       "   'Peter Hines',\n",
       "   'Zeus',\n",
       "   'Trevor West',\n",
       "   'Ogden Morrow',\n",
       "   'Aegeus',\n",
       "   'Ted',\n",
       "   'Local Man',\n",
       "   'Cura',\n",
       "   'Tomohisa Kaname',\n",
       "   'Priest A',\n",
       "   'Alexander Kaseph',\n",
       "   'Alfred Bellows',\n",
       "   'Tarble',\n",
       "   'Jewish Official',\n",
       "   'Spirit',\n",
       "   'Policeman Fire'],\n",
       "  'edge_list': [('Male', 'characters of this gender', 'Tarble'),\n",
       "   ('Male', 'characters of this gender', 'Ted'),\n",
       "   ('Male', 'characters of this gender', 'Brian Chavez'),\n",
       "   ('Male', 'characters of this gender', 'Dr. Lawrence Angelo'),\n",
       "   ('Male', 'characters of this gender', 'Tomohisa Kaname'),\n",
       "   ('Male', 'characters of this gender', 'Policeman Fire'),\n",
       "   ('Male', 'characters of this gender', 'Ogden Morrow'),\n",
       "   ('Male', 'characters of this gender', 'Alexander Kaseph'),\n",
       "   ('Male', 'characters of this gender', 'Local Man'),\n",
       "   ('Male', 'characters of this gender', 'Fabian'),\n",
       "   ('Male', 'characters of this gender', 'Peter Hines'),\n",
       "   ('Male', 'characters of this gender', 'Simon Phoenix'),\n",
       "   ('Male', 'characters of this gender', 'Cura'),\n",
       "   ('Male', 'characters of this gender', 'Buddy Walling'),\n",
       "   ('Male', 'characters of this gender', 'Spirit'),\n",
       "   ('Male', 'characters of this gender', 'Zeus'),\n",
       "   ('Male', 'characters of this gender', 'Old Man Willow'),\n",
       "   ('Male', 'characters of this gender', 'Alfred Bellows'),\n",
       "   ('Male', 'characters of this gender', 'Edgar Derby'),\n",
       "   ('Male', 'characters of this gender', 'The Elder Brother'),\n",
       "   ('Male', 'characters of this gender', 'Matter-Eater Lad'),\n",
       "   ('Male', 'characters of this gender', 'Trevor West'),\n",
       "   ('Male', 'characters of this gender', 'Jewish Official'),\n",
       "   ('Male', 'characters of this gender', 'Priest A'),\n",
       "   ('Male', 'characters of this gender', 'Archy Stallings'),\n",
       "   ('Male', 'characters of this gender', 'Aegeus')]},\n",
       " 'answer': ['Based on the world knowledge, the correct answer to the question is \"Elijah Blue Allman\", but the answer is not existing in the graph.'],\n",
       " 'answer_with_cot': [],\n",
       " 'difficulty': 'medium',\n",
       " 'from': 'WebQuestions'}"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "instruction_train_data[19]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "4a36afa3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "int"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(int(instruction_train_data[19][\"graph\"][\"edge_list\"][0][0]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "af8b7b82",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "73f2a92d",
   "metadata": {},
   "source": [
    "## 一、数据质量抽样\n",
    "随机抽样一部分样本，进行人工查阅"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "4c7dded3",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|█████████████████████████████| 1603436/1603436 [00:06<00:00, 246807.31it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "unanserable_num= 19\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|█████████████████████████████████| 50169/50169 [00:00<00:00, 123078.46it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "unanserable_num= 27\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|████████████████████████████████| 160335/160335 [00:02<00:00, 73984.17it/s]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "unanserable_num= 2\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|████████████████████████████████████| 5007/5007 [00:00<00:00, 43870.92it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "unanserable_num= 1\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "def process(examples: dict):\n",
    "    unanserable_num = 0\n",
    "    for example in tqdm(examples):\n",
    "        task_name = example[\"task_name\"]\n",
    "        answer = example[\"answer\"]\n",
    "        if answer == \"\" or len(answer) == 0 or answer[0] == \"\":\n",
    "            unanserable_num += 1\n",
    "#             example[\"answer\"] = [\"This question is unanswerable, so I cannot answer it.\"]\n",
    "            continue\n",
    "        answer_with_cot = example[\"answer_with_cot\"]\n",
    "        answer_with_cot = [str(i) for i in answer_with_cot]\n",
    "        example[\"answer_with_cot\"] = answer_with_cot\n",
    "        if type(example[\"graph\"]) == dict:\n",
    "            for key, values in example[\"graph\"].items():\n",
    "                if type(values) == set:\n",
    "                    example[\"graph\"][key] = list(values)\n",
    "            if \"node_feature\" in example[\"graph\"].keys():\n",
    "                new_feature = dict()\n",
    "                for k, v in example[\"graph\"][\"node_feature\"].items():\n",
    "                    if type(k) == np.int32:\n",
    "#                         print(type(k))\n",
    "                        k = str(k)\n",
    "#                         print(v)\n",
    "#                         assert 1>2\n",
    "                    if type(v) == set:\n",
    "                        v = list(v)\n",
    "                    new_feature[k] = v\n",
    "                example[\"graph\"][\"node_feature\"] = new_feature\n",
    "            if \"graph-structure-modeling\" in task_name or \"structure-graph-generation\" in task_name:\n",
    "                try:\n",
    "                    if \"node_list\" in example[\"graph\"].keys():\n",
    "                        example[\"graph\"][\"node_list\"] = [str(i) for i in example[\"graph\"][\"node_list\"]]\n",
    "                    if \"edge_list\" in example[\"graph\"].keys():\n",
    "                        example[\"graph\"][\"edge_list\"] = [[str(i) for i in pair] for pair in example[\"graph\"][\"edge_list\"]]\n",
    "                except:\n",
    "                    continue\n",
    "    print(\"unanserable_num=\", unanserable_num)\n",
    "    return examples\n",
    "\n",
    "instruction_train_data, instruction_test_data = process(instruction_train_data), process(instruction_test_data)\n",
    "instruction_train_data_small, instruction_test_data_small = process(instruction_train_data_small), process(instruction_test_data_small)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "f13dee4b",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████████████████████████| 1603436/1603436 [00:24<00:00, 64416.09it/s]\n",
      "100%|██████████████████████████████████| 50169/50169 [00:01<00:00, 46354.57it/s]\n",
      "100%|████████████████████████████████| 160335/160335 [00:04<00:00, 38341.21it/s]\n",
      "100%|████████████████████████████████████| 5007/5007 [00:00<00:00, 34494.17it/s]\n"
     ]
    }
   ],
   "source": [
    "# 对超过一定长度的样本进行剔除\n",
    "def clip_max_length(data):\n",
    "    examples = list()\n",
    "    for example in tqdm(data):\n",
    "        instruction = example[\"instruction\"]\n",
    "        answer = example[\"answer\"][0]\n",
    "        instruction_with_answer_len = len((instruction + answer).split(\" \"))\n",
    "        if instruction_with_answer_len >= 390:\n",
    "            continue\n",
    "        examples.append(example)\n",
    "    return examples\n",
    "\n",
    "instruction_train_data, instruction_test_data = clip_max_length(instruction_train_data), clip_max_length(instruction_test_data)\n",
    "instruction_train_data_small, instruction_test_data_small = clip_max_length(instruction_train_data_small), clip_max_length(instruction_test_data_small)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "427b7005",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1457122"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(instruction_train_data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "9cf44e0c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'task_name': 'graph-language-modeling-graph-caption-generation-eventna',\n",
       " 'idx': 22635,\n",
       " 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"factual-graph\"] {\\n    entity_list = [\"speed skating at the 2003 Asian Winter Games – women\\'s 500 metres\", \\'2003\\', \\'Japan\\'];\\n    triple_list = [(\"speed skating at the 2003 Asian Winter Games – women\\'s 500 metres\" -> \"Japan\")[relation=\"country\"], (\"speed skating at the 2003 Asian Winter Games – women\\'s 500 metres\" -> \"2003\")[relation=\"point in time\"]];\\n}\\n```\\nTask definition: given an event title and a factual knowledge graph, generate an event narration.\\nQ: Please generate an event narration based on the knowledge graph and the title \"speed skating at the 2003 Asian Winter Games – women\\'s 500 metres\".\\nA:',\n",
       " 'graph_language': '```\\nGraph[name=\"factual-graph\"] {\\n    entity_list = [\"speed skating at the 2003 Asian Winter Games – women\\'s 500 metres\", \\'2003\\', \\'Japan\\'];\\n    triple_list = [(\"speed skating at the 2003 Asian Winter Games – women\\'s 500 metres\" -> \"Japan\")[relation=\"country\"], (\"speed skating at the 2003 Asian Winter Games – women\\'s 500 metres\" -> \"2003\")[relation=\"point in time\"]];\\n}\\n```',\n",
       " 'graph': {'node_list': [\"speed skating at the 2003 Asian Winter Games – women's 500 metres\",\n",
       "   '2003',\n",
       "   'Japan'],\n",
       "  'edge_list': [[\"speed skating at the 2003 Asian Winter Games – women's 500 metres\",\n",
       "    'country',\n",
       "    'Japan'],\n",
       "   [\"speed skating at the 2003 Asian Winter Games – women's 500 metres\",\n",
       "    'point in time',\n",
       "    '2003']]},\n",
       " 'answer': [\"The speed skating at the 2003 Asian Winter Games – women's 500 metres at the 2003 Asian Winter Games was held on 2003 and 2003 in Hachinohe, Aomori Prefecture, Japan.\"],\n",
       " 'answer_with_cot': [],\n",
       " 'difficulty': 'medium',\n",
       " 'from': 'EventNarrative'}"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "instruction_train_data[190344]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f0563c28",
   "metadata": {},
   "source": [
    "**数据分层**\n",
    "\n",
    "instructGraph数据包含4个capacity corner：\n",
    "- graph structure modeling\n",
    "- graph language modeling\n",
    "- graph construction modeling\n",
    "- graph thought modeling\n",
    "\n",
    "每个capacity corner中包含若干task cluster，每个cluster中则为具体的task，分布情况如下所示"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "5a1966d4",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|█████████████████████████████| 1457122/1457122 [00:07<00:00, 197274.43it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "capacity name num: 4\n",
      "cluster name num: 18\n",
      "task name num: 60\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "instructgraph_task_info = {}\n",
    "instructgraph_taskset = set()\n",
    "\n",
    "task_capacity_num = 0\n",
    "task_cluster_num = 0\n",
    "\n",
    "for example in tqdm(instruction_train_data): # 训练集与测试集的分层形式一样，因此只需要统计训练集即可\n",
    "    capacity = \"-\".join(example[\"task_name\"].split(\"-\")[:3])\n",
    "    cluster = \"-\".join(example[\"task_name\"].split(\"-\")[3:6])\n",
    "    task_name = example[\"from\"]\n",
    "    \n",
    "    if capacity not in instructgraph_task_info.keys():\n",
    "        instructgraph_task_info[capacity] = dict()\n",
    "        task_capacity_num += 1\n",
    "    if cluster not in instructgraph_task_info[capacity]:\n",
    "        instructgraph_task_info[capacity][cluster] = set()\n",
    "        task_cluster_num += 1\n",
    "    instructgraph_task_info[capacity][cluster].add(task_name)\n",
    "    instructgraph_taskset.add(task_name)\n",
    "\n",
    "print(\"capacity name num: {}\".format(task_capacity_num))\n",
    "print(\"cluster name num: {}\".format(task_cluster_num))\n",
    "print(\"task name num: {}\".format(len(instructgraph_taskset)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "5fefa2f4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Agenda',\n",
       " 'Amazon',\n",
       " 'CiteSeer',\n",
       " 'CoRA',\n",
       " 'ConceptNet',\n",
       " 'EventNarrative',\n",
       " 'FB15k-237',\n",
       " 'GenWiki',\n",
       " 'GrailQA',\n",
       " 'GraphCaption-Wikipedia',\n",
       " 'GraphCaptionGeneration',\n",
       " 'InstructionKGC',\n",
       " 'InstructionUIE-ADE_corpus',\n",
       " 'InstructionUIE-ADE_corpus_sample_15000',\n",
       " 'InstructionUIE-GIDS',\n",
       " 'InstructionUIE-NYT11',\n",
       " 'InstructionUIE-NYT11_sample_30000',\n",
       " 'InstructionUIE-New-York-Times-RE',\n",
       " 'InstructionUIE-New-York-Times-RE_sample_30000',\n",
       " 'InstructionUIE-SciERC',\n",
       " 'InstructionUIE-SciERC_sample_10000',\n",
       " 'InstructionUIE-conll04',\n",
       " 'InstructionUIE-conll04_sample_5000',\n",
       " 'InstructionUIE-fewrel_0',\n",
       " 'InstructionUIE-fewrel_1',\n",
       " 'InstructionUIE-fewrel_2',\n",
       " 'InstructionUIE-fewrel_3',\n",
       " 'InstructionUIE-fewrel_4',\n",
       " 'InstructionUIE-kbp37',\n",
       " 'InstructionUIE-semval-RE',\n",
       " 'InstructionUIE-wiki_0',\n",
       " 'InstructionUIE-wiki_1',\n",
       " 'InstructionUIE-wiki_2',\n",
       " 'InstructionUIE-wiki_3',\n",
       " 'InstructionUIE-wiki_4',\n",
       " 'LastFM',\n",
       " 'MoiveLens',\n",
       " 'NLGraph',\n",
       " 'NLPReasonong-AQuA',\n",
       " 'NLPReasonong-ARC-c',\n",
       " 'NLPReasonong-Coin-Flip',\n",
       " 'NLPReasonong-CommonsenseQA',\n",
       " 'NLPReasonong-GSM8K',\n",
       " 'NLPReasonong-Last-Letters',\n",
       " 'NLPReasonong-MultiArith',\n",
       " 'NLPReasonong-OpenBookQA',\n",
       " 'NLPReasonong-SVAMP',\n",
       " 'OGBN-ArXiv',\n",
       " 'OGBN-Products',\n",
       " 'PathQuestion',\n",
       " 'Probing-GrailQA',\n",
       " 'Probing-WebQuestions',\n",
       " 'PubMed',\n",
       " 'WC2014',\n",
       " 'WebNLG',\n",
       " 'WebQuestions',\n",
       " 'WikiTableQuestions',\n",
       " 'Wikidata5M',\n",
       " 'Wikipedia-Wikidata5M',\n",
       " 'XAlign'}"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(instructgraph_taskset)\n",
    "instructgraph_taskset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "02a11a96",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'graph-language-modeling': {'graph-question-answering': {'GrailQA',\n",
       "   'PathQuestion',\n",
       "   'WC2014',\n",
       "   'WebQuestions',\n",
       "   'WikiTableQuestions'},\n",
       "  'graph-link-prediction': {'ConceptNet', 'FB15k-237', 'Wikidata5M'},\n",
       "  'graph-node-cls': {'CiteSeer',\n",
       "   'CoRA',\n",
       "   'OGBN-ArXiv',\n",
       "   'OGBN-Products',\n",
       "   'PubMed'},\n",
       "  'graph-caption-generation': {'Agenda',\n",
       "   'EventNarrative',\n",
       "   'GenWiki',\n",
       "   'WebNLG',\n",
       "   'Wikipedia-Wikidata5M',\n",
       "   'XAlign'},\n",
       "  'graph-collaboration-filtering': {'Amazon', 'LastFM', 'MoiveLens'},\n",
       "  'graph-relevance-inspection': {'GraphCaptionGeneration'}},\n",
       " 'graph-structure-modeling': {'connectivity-detection': {'NLGraph'},\n",
       "  'cycle-detection': {'NLGraph'},\n",
       "  'maximum-flow': {'NLGraph'},\n",
       "  'hamilton-path': {'NLGraph'},\n",
       "  'job-interest': {'NLGraph'},\n",
       "  'shortest-path': {'NLGraph'},\n",
       "  'topological-sort': {'NLGraph'},\n",
       "  'degree-computing': {'NLGraph'}},\n",
       " 'graph-construction-modeling': {'structure-graph-generation': {'NLGraph'},\n",
       "  'knowledge-graph-generation': {'GraphCaption-Wikipedia',\n",
       "   'InstructionKGC',\n",
       "   'InstructionUIE-ADE_corpus',\n",
       "   'InstructionUIE-ADE_corpus_sample_15000',\n",
       "   'InstructionUIE-GIDS',\n",
       "   'InstructionUIE-NYT11',\n",
       "   'InstructionUIE-NYT11_sample_30000',\n",
       "   'InstructionUIE-New-York-Times-RE',\n",
       "   'InstructionUIE-New-York-Times-RE_sample_30000',\n",
       "   'InstructionUIE-SciERC',\n",
       "   'InstructionUIE-SciERC_sample_10000',\n",
       "   'InstructionUIE-conll04',\n",
       "   'InstructionUIE-conll04_sample_5000',\n",
       "   'InstructionUIE-fewrel_0',\n",
       "   'InstructionUIE-fewrel_1',\n",
       "   'InstructionUIE-fewrel_2',\n",
       "   'InstructionUIE-fewrel_3',\n",
       "   'InstructionUIE-fewrel_4',\n",
       "   'InstructionUIE-kbp37',\n",
       "   'InstructionUIE-semval-RE',\n",
       "   'InstructionUIE-wiki_0',\n",
       "   'InstructionUIE-wiki_1',\n",
       "   'InstructionUIE-wiki_2',\n",
       "   'InstructionUIE-wiki_3',\n",
       "   'InstructionUIE-wiki_4'}},\n",
       " 'graph-thought-modeling': {'factual-knowledge-probing': {'Probing-GrailQA',\n",
       "   'Probing-WebQuestions'},\n",
       "  'natural-language-reasoning': {'NLPReasonong-AQuA',\n",
       "   'NLPReasonong-ARC-c',\n",
       "   'NLPReasonong-Coin-Flip',\n",
       "   'NLPReasonong-CommonsenseQA',\n",
       "   'NLPReasonong-GSM8K',\n",
       "   'NLPReasonong-Last-Letters',\n",
       "   'NLPReasonong-MultiArith',\n",
       "   'NLPReasonong-OpenBookQA',\n",
       "   'NLPReasonong-SVAMP'}}}"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "instructgraph_task_info"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3d7ffc4d",
   "metadata": {},
   "source": [
    "**不同task的样本数量统计**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "211459d8",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "29882996",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|█████████████████████████████| 1457122/1457122 [00:07<00:00, 192542.37it/s]\n",
      "100%|██████████████████████████████████| 38822/38822 [00:00<00:00, 87329.74it/s]\n"
     ]
    }
   ],
   "source": [
    "instructgraph_scale_info = {\n",
    "    \"train\": {\n",
    "        \"capacity_specific\": {},\n",
    "        \"cluster_specific\": {},\n",
    "        \"task_specific\": {}\n",
    "    },\n",
    "    \"test\": {\n",
    "        \"capacity_specific\": {},\n",
    "        \"cluster_specific\": {},\n",
    "        \"task_specific\": {}\n",
    "    },\n",
    "}\n",
    "\n",
    "\n",
    "def data_scale_statistics(data: list, data_kind: str = \"train\"):\n",
    "    for example in tqdm(data):\n",
    "        capacity = \"-\".join(example[\"task_name\"].split(\"-\")[:3])\n",
    "        cluster = \"-\".join(example[\"task_name\"].split(\"-\")[3:6])\n",
    "        task_name = example[\"from\"]\n",
    "        \n",
    "        if capacity not in instructgraph_scale_info[data_kind][\"capacity_specific\"].keys():\n",
    "            instructgraph_scale_info[data_kind][\"capacity_specific\"][capacity] = 0\n",
    "        instructgraph_scale_info[data_kind][\"capacity_specific\"][capacity] += 1\n",
    "        \n",
    "        if cluster not in instructgraph_scale_info[data_kind][\"cluster_specific\"].keys():\n",
    "            instructgraph_scale_info[data_kind][\"cluster_specific\"][cluster] = 0\n",
    "        instructgraph_scale_info[data_kind][\"cluster_specific\"][cluster] += 1\n",
    "        \n",
    "        if task_name not in instructgraph_scale_info[data_kind][\"task_specific\"].keys():\n",
    "            instructgraph_scale_info[data_kind][\"task_specific\"][task_name] = 0\n",
    "        instructgraph_scale_info[data_kind][\"task_specific\"][task_name] += 1\n",
    "\n",
    "data_scale_statistics(instruction_train_data, \"train\")\n",
    "data_scale_statistics(instruction_test_data, \"test\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8a8b0854",
   "metadata": {},
   "source": [
    "### 训练集数据分布情况"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "89a8ffb7",
   "metadata": {},
   "source": [
    "**capacity manner**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "4a9cf3da",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'graph-language-modeling': 1048151,\n",
       " 'graph-structure-modeling': 16013,\n",
       " 'graph-construction-modeling': 390595,\n",
       " 'graph-thought-modeling': 2363}"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "instructgraph_scale_info[\"train\"][\"capacity_specific\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ec155c37",
   "metadata": {},
   "source": [
    "**cluster manner**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "9e38482a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'graph-question-answering': 64727,\n",
       " 'connectivity-detection': 3628,\n",
       " 'cycle-detection': 2877,\n",
       " 'maximum-flow': 1335,\n",
       " 'hamilton-path': 1305,\n",
       " 'job-interest': 1715,\n",
       " 'shortest-path': 1580,\n",
       " 'topological-sort': 1155,\n",
       " 'degree-computing': 2418,\n",
       " 'structure-graph-generation': 2990,\n",
       " 'graph-link-prediction': 68937,\n",
       " 'factual-knowledge-probing': 2292,\n",
       " 'graph-node-cls': 40401,\n",
       " 'graph-caption-generation': 752139,\n",
       " 'knowledge-graph-generation': 387605,\n",
       " 'graph-collaboration-filtering': 82385,\n",
       " 'graph-relevance-inspection': 39562,\n",
       " 'natural-language-reasoning': 71}"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "instructgraph_scale_info[\"train\"][\"cluster_specific\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d716f20c",
   "metadata": {},
   "source": [
    "**task manner**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "0b32dcc0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'WebQuestions': 12351,\n",
       " 'NLGraph': 19003,\n",
       " 'WC2014': 5482,\n",
       " 'FB15k-237': 2528,\n",
       " 'Probing-GrailQA': 1859,\n",
       " 'Probing-WebQuestions': 433,\n",
       " 'PubMed': 9984,\n",
       " 'Agenda': 36501,\n",
       " 'OGBN-ArXiv': 8933,\n",
       " 'InstructionKGC': 30206,\n",
       " 'CoRA': 551,\n",
       " 'Amazon': 2385,\n",
       " 'GraphCaptionGeneration': 39562,\n",
       " 'EventNarrative': 58597,\n",
       " 'PathQuestion': 30530,\n",
       " 'GenWiki': 100000,\n",
       " 'CiteSeer': 942,\n",
       " 'XAlign': 30000,\n",
       " 'WebNLG': 12237,\n",
       " 'NLPReasonong-AQuA': 1,\n",
       " 'NLPReasonong-GSM8K': 8,\n",
       " 'NLPReasonong-SVAMP': 7,\n",
       " 'NLPReasonong-MultiArith': 10,\n",
       " 'NLPReasonong-ARC-c': 2,\n",
       " 'NLPReasonong-CommonsenseQA': 13,\n",
       " 'NLPReasonong-OpenBookQA': 1,\n",
       " 'NLPReasonong-Coin-Flip': 10,\n",
       " 'NLPReasonong-Last-Letters': 19,\n",
       " 'OGBN-Products': 19991,\n",
       " 'GrailQA': 13647,\n",
       " 'LastFM': 40000,\n",
       " 'MoiveLens': 40000,\n",
       " 'Wikipedia-Wikidata5M': 514804,\n",
       " 'InstructionUIE-wiki_4': 5543,\n",
       " 'InstructionUIE-New-York-Times-RE': 56178,\n",
       " 'InstructionUIE-New-York-Times-RE_sample_30000': 29987,\n",
       " 'InstructionUIE-fewrel_3': 3454,\n",
       " 'InstructionUIE-semval-RE': 6507,\n",
       " 'InstructionUIE-wiki_1': 4471,\n",
       " 'InstructionUIE-GIDS': 8526,\n",
       " 'InstructionUIE-SciERC_sample_10000': 10000,\n",
       " 'InstructionUIE-ADE_corpus': 3417,\n",
       " 'InstructionUIE-wiki_0': 5134,\n",
       " 'InstructionUIE-SciERC': 1366,\n",
       " 'InstructionUIE-kbp37': 15917,\n",
       " 'InstructionUIE-wiki_2': 3102,\n",
       " 'InstructionUIE-fewrel_1': 3460,\n",
       " 'InstructionUIE-conll04': 922,\n",
       " 'InstructionUIE-fewrel_4': 3479,\n",
       " 'InstructionUIE-NYT11': 62644,\n",
       " 'InstructionUIE-conll04_sample_5000': 5000,\n",
       " 'InstructionUIE-fewrel_0': 3423,\n",
       " 'InstructionUIE-wiki_3': 4863,\n",
       " 'InstructionUIE-NYT11_sample_30000': 29997,\n",
       " 'InstructionUIE-fewrel_2': 3475,\n",
       " 'InstructionUIE-ADE_corpus_sample_15000': 15000,\n",
       " 'WikiTableQuestions': 2717,\n",
       " 'GraphCaption-Wikipedia': 71534,\n",
       " 'ConceptNet': 18467,\n",
       " 'Wikidata5M': 47942}"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "instructgraph_scale_info[\"train\"][\"task_specific\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "836e86e2",
   "metadata": {},
   "source": [
    "### 测试集数据分布情况"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cb6204ea",
   "metadata": {},
   "source": [
    "**capacity manner**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "d6e74709",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'graph-language-modeling': 29501,\n",
       " 'graph-structure-modeling': 972,\n",
       " 'graph-construction-modeling': 6156,\n",
       " 'graph-thought-modeling': 2193}"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "instructgraph_scale_info[\"test\"][\"capacity_specific\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "52dde8bd",
   "metadata": {},
   "source": [
    "**cluster manner**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "0f316b92",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'graph-question-answering': 5423,\n",
       " 'connectivity-detection': 227,\n",
       " 'cycle-detection': 191,\n",
       " 'maximum-flow': 55,\n",
       " 'hamilton-path': 54,\n",
       " 'job-interest': 69,\n",
       " 'shortest-path': 64,\n",
       " 'topological-sort': 85,\n",
       " 'degree-computing': 227,\n",
       " 'structure-graph-generation': 397,\n",
       " 'graph-link-prediction': 3697,\n",
       " 'factual-knowledge-probing': 194,\n",
       " 'graph-node-cls': 5826,\n",
       " 'graph-caption-generation': 8318,\n",
       " 'knowledge-graph-generation': 5759,\n",
       " 'graph-collaboration-filtering': 4249,\n",
       " 'graph-relevance-inspection': 1988,\n",
       " 'natural-language-reasoning': 1999}"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "instructgraph_scale_info[\"test\"][\"cluster_specific\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7f72fb1a",
   "metadata": {},
   "source": [
    "**task manner**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "2826072e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'WebQuestions': 1364,\n",
       " 'NLGraph': 1369,\n",
       " 'WC2014': 1000,\n",
       " 'FB15k-237': 78,\n",
       " 'Probing-GrailQA': 158,\n",
       " 'Probing-WebQuestions': 36,\n",
       " 'PubMed': 1802,\n",
       " 'Agenda': 935,\n",
       " 'OGBN-ArXiv': 349,\n",
       " 'InstructionKGC': 990,\n",
       " 'CoRA': 965,\n",
       " 'Amazon': 249,\n",
       " 'GraphCaptionGeneration': 1988,\n",
       " 'EventNarrative': 1945,\n",
       " 'PathQuestion': 1000,\n",
       " 'GenWiki': 1000,\n",
       " 'CiteSeer': 995,\n",
       " 'XAlign': 470,\n",
       " 'WebNLG': 2000,\n",
       " 'NLPReasonong-GSM8K': 267,\n",
       " 'NLPReasonong-ARC-c': 262,\n",
       " 'NLPReasonong-CommonsenseQA': 260,\n",
       " 'NLPReasonong-Coin-Flip': 110,\n",
       " 'NLPReasonong-StrategyQA': 501,\n",
       " 'NLPReasonong-SVAMP': 193,\n",
       " 'NLPReasonong-OpenBookQA': 112,\n",
       " 'NLPReasonong-AQuA': 62,\n",
       " 'NLPReasonong-MultiArith': 128,\n",
       " 'NLPReasonong-Last-Letters': 104,\n",
       " 'OGBN-Products': 1715,\n",
       " 'GrailQA': 1404,\n",
       " 'LastFM': 2000,\n",
       " 'MoiveLens': 2000,\n",
       " 'Wikipedia-Wikidata5M': 1968,\n",
       " 'InstructionUIE-semval-RE': 122,\n",
       " 'InstructionUIE-wiki_4': 267,\n",
       " 'InstructionUIE-kbp37': 156,\n",
       " 'InstructionUIE-conll04_zeroshot': 75,\n",
       " 'InstructionUIE-fewrel_1': 154,\n",
       " 'InstructionUIE-ADE_corpus_sample_15000': 20,\n",
       " 'InstructionUIE-fewrel_2': 167,\n",
       " 'InstructionUIE-New-York-Times-RE_sample_30000': 226,\n",
       " 'InstructionUIE-wiki_1': 216,\n",
       " 'InstructionUIE-GIDS': 227,\n",
       " 'InstructionUIE-conll04': 15,\n",
       " 'InstructionUIE-wiki_0': 214,\n",
       " 'InstructionUIE-NYT11': 11,\n",
       " 'InstructionUIE-fewrel_0': 169,\n",
       " 'InstructionUIE-New-York-Times-RE': 228,\n",
       " 'InstructionUIE-wiki_3': 223,\n",
       " 'InstructionUIE-fewrel_3': 149,\n",
       " 'InstructionUIE-wiki_2': 132,\n",
       " 'InstructionUIE-fewrel_4': 140,\n",
       " 'InstructionUIE-SciERC_sample_10000': 17,\n",
       " 'InstructionUIE-SciERC': 19,\n",
       " 'InstructionUIE-ADE_corpus': 16,\n",
       " 'InstructionUIE-NYT11_sample_30000': 20,\n",
       " 'InstructionUIE-conll04_sample_5000': 17,\n",
       " 'WikiTableQuestions': 655,\n",
       " 'GraphCaption-Wikipedia': 1769,\n",
       " 'ConceptNet': 519,\n",
       " 'Wikidata5M': 3100}"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "instructgraph_scale_info[\"test\"][\"task_specific\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d5757fdf",
   "metadata": {},
   "source": [
    "## 二、分词与长度检验\n",
    "检验样本分词后的长度"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "1350dbed",
   "metadata": {},
   "outputs": [],
   "source": [
    "from transformers.models.llama.tokenization_llama import LlamaTokenizer\n",
    "from transformers.models.gpt2.tokenization_gpt2 import GPT2Tokenizer\n",
    "from transformers.models.t5.tokenization_t5 import T5Tokenizer"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "id": "1742e952",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "You are using the default legacy behaviour of the <class 'transformers.models.llama.tokenization_llama.LlamaTokenizer'>. If you see this, DO NOT PANIC! This is expected, and simply means that the `legacy` (previous) behavior will be used so nothing changes for you. If you want to use the new behaviour, set `legacy=False`. This should only be set if you understand what it means, and thouroughly read the reason why this was added as explained in https://github.com/huggingface/transformers/pull/24565\n",
      "You are using the default legacy behaviour of the <class 'transformers.models.t5.tokenization_t5.T5Tokenizer'>. If you see this, DO NOT PANIC! This is expected, and simply means that the `legacy` (previous) behavior will be used so nothing changes for you. If you want to use the new behaviour, set `legacy=False`. This should only be set if you understand what it means, and thouroughly read the reason why this was added as explained in https://github.com/huggingface/transformers/pull/24565\n"
     ]
    }
   ],
   "source": [
    "llama2_tokenizer = LlamaTokenizer.from_pretrained(\"meta-llama/Llama-2-7b\", token=\"See Your Huggingface Access Tokens in https://huggingface.co/settings/tokens .\")\n",
    "gpt2_tokenizer = GPT2Tokenizer.from_pretrained(\"gpt2\")\n",
    "flant5_tokenizer = T5Tokenizer.from_pretrained(\"google/flan-t5-xxl\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "c2aa3e75",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['▁You',\n",
       " '▁are',\n",
       " '▁a',\n",
       " '▁good',\n",
       " '▁graph',\n",
       " '▁reason',\n",
       " 'er',\n",
       " '.',\n",
       " '▁Give',\n",
       " '▁you',\n",
       " '▁a',\n",
       " '▁graph',\n",
       " '▁language',\n",
       " '▁that',\n",
       " '▁describes',\n",
       " '▁a',\n",
       " '▁graph',\n",
       " '▁structure',\n",
       " '▁and',\n",
       " '▁node',\n",
       " '▁information',\n",
       " '.',\n",
       " '▁You',\n",
       " '▁need',\n",
       " '▁to',\n",
       " '▁understand',\n",
       " '▁the',\n",
       " '▁graph',\n",
       " '▁and',\n",
       " '▁the',\n",
       " '▁task',\n",
       " '▁definition',\n",
       " ',',\n",
       " '▁and',\n",
       " '▁answer',\n",
       " '▁the',\n",
       " '▁question',\n",
       " '.',\n",
       " '<0x0A>',\n",
       " 'Note',\n",
       " ':',\n",
       " '▁(',\n",
       " 'i',\n",
       " '▁<',\n",
       " '->',\n",
       " '▁j',\n",
       " ')',\n",
       " '▁means',\n",
       " '▁that',\n",
       " '▁node',\n",
       " '▁i',\n",
       " '▁and',\n",
       " '▁node',\n",
       " '▁j',\n",
       " '▁are',\n",
       " '▁connected',\n",
       " '▁with',\n",
       " '▁an',\n",
       " '▁und',\n",
       " 'irect',\n",
       " 'ed',\n",
       " '▁edge',\n",
       " '.',\n",
       " '▁(',\n",
       " 'i',\n",
       " '▁->',\n",
       " '▁j',\n",
       " ')',\n",
       " '▁means',\n",
       " '▁that',\n",
       " '▁node',\n",
       " '▁i',\n",
       " '▁and',\n",
       " '▁node',\n",
       " '▁j',\n",
       " '▁are',\n",
       " '▁connected',\n",
       " '▁with',\n",
       " '▁a',\n",
       " '▁directed',\n",
       " '▁edge',\n",
       " '.',\n",
       " '▁',\n",
       " '<0x0A>',\n",
       " '```',\n",
       " '<0x0A>',\n",
       " 'Graph',\n",
       " '[',\n",
       " 'name',\n",
       " '=\"',\n",
       " 'cycle',\n",
       " '-',\n",
       " 'd',\n",
       " 'ete',\n",
       " 'ction',\n",
       " '\"]',\n",
       " '▁{',\n",
       " '<0x0A>',\n",
       " '▁▁▁',\n",
       " '▁node',\n",
       " '_',\n",
       " 'list',\n",
       " '▁=',\n",
       " '▁[',\n",
       " '0',\n",
       " ',',\n",
       " '▁',\n",
       " '1',\n",
       " ',',\n",
       " '▁',\n",
       " '2',\n",
       " ',',\n",
       " '▁',\n",
       " '3',\n",
       " ',',\n",
       " '▁',\n",
       " '4',\n",
       " ',',\n",
       " '▁',\n",
       " '5',\n",
       " ',',\n",
       " '▁',\n",
       " '6',\n",
       " ',',\n",
       " '▁',\n",
       " '7',\n",
       " ',',\n",
       " '▁',\n",
       " '8',\n",
       " ',',\n",
       " '▁',\n",
       " '9',\n",
       " ',',\n",
       " '▁',\n",
       " '1',\n",
       " '0',\n",
       " ',',\n",
       " '▁',\n",
       " '1',\n",
       " '1',\n",
       " ',',\n",
       " '▁',\n",
       " '1',\n",
       " '2',\n",
       " ',',\n",
       " '▁',\n",
       " '1',\n",
       " '3',\n",
       " ',',\n",
       " '▁',\n",
       " '1',\n",
       " '4',\n",
       " ',',\n",
       " '▁',\n",
       " '1',\n",
       " '5',\n",
       " ',',\n",
       " '▁',\n",
       " '1',\n",
       " '6',\n",
       " '];',\n",
       " '<0x0A>',\n",
       " '▁▁▁',\n",
       " '▁edge',\n",
       " '_',\n",
       " 'list',\n",
       " '▁=',\n",
       " '▁[(',\n",
       " '1',\n",
       " '▁<',\n",
       " '->',\n",
       " '▁',\n",
       " '8',\n",
       " '),',\n",
       " '▁(',\n",
       " '3',\n",
       " '▁<',\n",
       " '->',\n",
       " '▁',\n",
       " '1',\n",
       " '3',\n",
       " '),',\n",
       " '▁(',\n",
       " '1',\n",
       " '1',\n",
       " '▁<',\n",
       " '->',\n",
       " '▁',\n",
       " '1',\n",
       " '3',\n",
       " '),',\n",
       " '▁(',\n",
       " '2',\n",
       " '▁<',\n",
       " '->',\n",
       " '▁',\n",
       " '3',\n",
       " '),',\n",
       " '▁(',\n",
       " '2',\n",
       " '▁<',\n",
       " '->',\n",
       " '▁',\n",
       " '1',\n",
       " '4',\n",
       " '),',\n",
       " '▁(',\n",
       " '1',\n",
       " '▁<',\n",
       " '->',\n",
       " '▁',\n",
       " '6',\n",
       " '),',\n",
       " '▁(',\n",
       " '1',\n",
       " '4',\n",
       " '▁<',\n",
       " '->',\n",
       " '▁',\n",
       " '4',\n",
       " '),',\n",
       " '▁(',\n",
       " '1',\n",
       " '6',\n",
       " '▁<',\n",
       " '->',\n",
       " '▁',\n",
       " '6',\n",
       " '),',\n",
       " '▁(',\n",
       " '7',\n",
       " '▁<',\n",
       " '->',\n",
       " '▁',\n",
       " '1',\n",
       " '4',\n",
       " '),',\n",
       " '▁(',\n",
       " '1',\n",
       " '2',\n",
       " '▁<',\n",
       " '->',\n",
       " '▁',\n",
       " '1',\n",
       " '6',\n",
       " '),',\n",
       " '▁(',\n",
       " '0',\n",
       " '▁<',\n",
       " '->',\n",
       " '▁',\n",
       " '4',\n",
       " '),',\n",
       " '▁(',\n",
       " '5',\n",
       " '▁<',\n",
       " '->',\n",
       " '▁',\n",
       " '1',\n",
       " '2',\n",
       " '),',\n",
       " '▁(',\n",
       " '1',\n",
       " '0',\n",
       " '▁<',\n",
       " '->',\n",
       " '▁',\n",
       " '1',\n",
       " '1',\n",
       " '),',\n",
       " '▁(',\n",
       " '9',\n",
       " '▁<',\n",
       " '->',\n",
       " '▁',\n",
       " '5',\n",
       " '),',\n",
       " '▁(',\n",
       " '8',\n",
       " '▁<',\n",
       " '->',\n",
       " '▁',\n",
       " '1',\n",
       " '4',\n",
       " '),',\n",
       " '▁(',\n",
       " '1',\n",
       " '5',\n",
       " '▁<',\n",
       " '->',\n",
       " '▁',\n",
       " '3',\n",
       " ')];',\n",
       " '<0x0A>',\n",
       " '}',\n",
       " '<0x0A>',\n",
       " '```',\n",
       " '<0x0A>',\n",
       " 'Task',\n",
       " '▁definition',\n",
       " ':',\n",
       " '▁determine',\n",
       " '▁if',\n",
       " '▁there',\n",
       " '▁is',\n",
       " '▁a',\n",
       " '▁cycle',\n",
       " '▁in',\n",
       " '▁this',\n",
       " '▁graph',\n",
       " '.',\n",
       " '<0x0A>',\n",
       " 'Q',\n",
       " ':',\n",
       " '▁Is',\n",
       " '▁there',\n",
       " '▁a',\n",
       " '▁cycle',\n",
       " '▁in',\n",
       " '▁this',\n",
       " '▁graph',\n",
       " '?',\n",
       " '<0x0A>',\n",
       " 'A',\n",
       " ':']"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = llama2_tokenizer.tokenize(\"You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\\\"cycle-detection\\\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];\\n    edge_list = [(1 <-> 8), (3 <-> 13), (11 <-> 13), (2 <-> 3), (2 <-> 14), (1 <-> 6), (14 <-> 4), (16 <-> 6), (7 <-> 14), (12 <-> 16), (0 <-> 4), (5 <-> 12), (10 <-> 11), (9 <-> 5), (8 <-> 14), (15 <-> 3)];\\n}\\n```\\nTask definition: determine if there is a cycle in this graph.\\nQ: Is there a cycle in this graph?\\nA:\")\n",
    "a\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "id": "9c6ce883",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1, 29871, 29946, 29941, 29946, 29941, 887, 526, 263, 1781, 3983, 2769, 261]"
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "llama2_tokenizer.encode(\"4343 You are a good graph reasoner\", add_special_tokens=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "83a43c8c",
   "metadata": {},
   "source": [
    "因为样本数量太多，为了加快统计的速度，因此对不同的数据集分别进行均匀采样进行统计估计。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9a42fa16",
   "metadata": {},
   "source": [
    "### 统计不同分词器分词前后token长度"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "3df6d460",
   "metadata": {},
   "outputs": [],
   "source": [
    "instructgraph_token_info = {\n",
    "    \"before_tokenization\": { # 分词前长度信息统计\n",
    "        \"overall\": { # 所有样本统计\n",
    "            \"avg\": { # 所有样本的平均统计\n",
    "                \"instruction\": 0.0,\n",
    "                \"answer\": 0.0,\n",
    "                \"answer_with_cot\": 0.0,\n",
    "                \"instruction_plus_answer\": 0.0,\n",
    "                \"graph_language\": 0.0,\n",
    "            },\n",
    "            \"example_distribution\": { # 所有样本中，每个样本长度区间的统计分布\n",
    "\n",
    "            }\n",
    "        },\n",
    "    },\n",
    "    \"after_tokenization\": {\n",
    "        \"llama2\": {\n",
    "            \"overall\": { # 所有样本统计\n",
    "                \"avg\": { # 所有样本的平均统计\n",
    "                    \"instruction\": 0.0,\n",
    "                    \"answer\": 0.0,\n",
    "                    \"answer_with_cot\": 0.0,\n",
    "                    \"instruction_plus_answer\": 0.0,\n",
    "                    \"graph_language\": 0.0,\n",
    "                },\n",
    "                \"example_distribution\": { # 所有样本中，每个样本长度区间的统计分布\n",
    "\n",
    "                }\n",
    "            },\n",
    "        },\n",
    "        \"gpt2\": {\n",
    "            \"overall\": { # 所有样本统计\n",
    "                \"avg\": { # 所有样本的平均统计\n",
    "                    \"instruction\": 0.0,\n",
    "                    \"answer\": 0.0,\n",
    "                    \"answer_with_cot\": 0.0,\n",
    "                    \"instruction_plus_answer\": 0.0,\n",
    "                    \"graph_language\": 0.0,\n",
    "                },\n",
    "                \"example_distribution\": { # 所有样本中，每个样本长度区间的统计分布\n",
    "\n",
    "                }\n",
    "            },\n",
    "        },\n",
    "        \"flan-t5\": {\n",
    "            \"overall\": { # 所有样本统计\n",
    "                \"avg\": { # 所有样本的平均统计\n",
    "                    \"instruction\": 0.0,\n",
    "                    \"answer\": 0.0,\n",
    "                    \"answer_with_cot\": 0.0,\n",
    "                    \"instruction_plus_answer\": 0.0,\n",
    "                    \"graph_language\": 0.0,\n",
    "                },\n",
    "                \"example_distribution\": { # 所有样本中，每个样本长度区间的统计分布\n",
    "\n",
    "                }\n",
    "            },\n",
    "        }\n",
    "    }\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "05128022",
   "metadata": {},
   "outputs": [],
   "source": [
    "def before_tokenization_statistic(example: dict):\n",
    "    # 分词前，对样本本身统计\n",
    "    # 分词前的统计方式是以空格为分隔符进行分词\n",
    "    instruction_num, instruction_token_sum = 0, 0\n",
    "    answer_num, answer_token_sum = 0, 0\n",
    "    answer_with_cot_num, answer_with_cot_token_sum = 0, 0\n",
    "    instruction_plus_answer_num, instruction_plus_answer_token_sum = 0, 0\n",
    "    graph_language_num, graph_language_token_sum = 0, 0\n",
    "    \n",
    "    instruction = example[\"instruction\"]\n",
    "    answer = example[\"answer\"]\n",
    "    answer_with_cot = example[\"answer_with_cot\"]\n",
    "    graph_language = example[\"graph_language\"]\n",
    "    \n",
    "    instruction_num += 1\n",
    "    cur_instruction_len = len(instruction.split(\" \"))\n",
    "    instruction_token_sum += cur_instruction_len\n",
    "\n",
    "    if len(answer) != 0:\n",
    "        answer_num += 1\n",
    "        instruction_plus_answer_num += 1\n",
    "        cur_answer_len = len(answer[0].split(\" \"))\n",
    "        answer_token_sum += cur_answer_len\n",
    "        instruction_plus_answer_token_sum += cur_instruction_len + cur_answer_len\n",
    "\n",
    "    if len(answer_with_cot) != 0:\n",
    "        answer_with_cot_num += 1\n",
    "        answer_with_cot_token_sum += len(answer_with_cot[0].split(\" \"))\n",
    "\n",
    "    if \"Graph[name=\" in graph_language:\n",
    "        graph_language_num += 1\n",
    "        graph_language_token_sum += len(graph_language.split(\" \"))\n",
    "    \n",
    "    return {\n",
    "        \"task_name\": example[\"task_name\"],\n",
    "        \"instruction_num\": instruction_num,\n",
    "        \"instruction_token_sum\": instruction_token_sum,\n",
    "        \"answer_num\": answer_num,\n",
    "        \"answer_token_sum\": answer_token_sum,\n",
    "        \"answer_with_cot_num\": answer_with_cot_num,\n",
    "        \"answer_with_cot_token_sum\": answer_with_cot_token_sum,\n",
    "        \"instruction_plus_answer_num\": instruction_plus_answer_num,\n",
    "        \"instruction_plus_answer_token_sum\": instruction_plus_answer_token_sum,\n",
    "        \"graph_language_num\": graph_language_num,\n",
    "        \"graph_language_token_sum\": graph_language_token_sum,\n",
    "    }\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "83dba2e2",
   "metadata": {},
   "outputs": [],
   "source": [
    "def after_tokenization_statistic(example: dict, tokenizer):\n",
    "    # 分词前，对样本本身统计\n",
    "    # 分词前的统计方式是以空格为分隔符进行分词\n",
    "    instruction_num, instruction_token_sum = 0, 0\n",
    "    answer_num, answer_token_sum = 0, 0\n",
    "    answer_with_cot_num, answer_with_cot_token_sum = 0, 0\n",
    "    instruction_plus_answer_num, instruction_plus_answer_token_sum = 0, 0\n",
    "    graph_language_num, graph_language_token_sum = 0, 0\n",
    "    \n",
    "    instruction = example[\"instruction\"]\n",
    "    answer = example[\"answer\"]\n",
    "    answer_with_cot = example[\"answer_with_cot\"]\n",
    "    graph_language = example[\"graph_language\"]\n",
    "    \n",
    "    instruction_num += 1\n",
    "    cur_instruction_len = len(tokenizer.tokenize(instruction))\n",
    "    instruction_token_sum += cur_instruction_len\n",
    "\n",
    "    if len(answer) != 0:\n",
    "        answer_num += 1\n",
    "        instruction_plus_answer_num += 1\n",
    "        cur_answer_len = len(tokenizer.tokenize(answer[0]))\n",
    "        answer_token_sum += cur_answer_len\n",
    "        instruction_plus_answer_token_sum += cur_instruction_len + cur_answer_len\n",
    "\n",
    "    if len(answer_with_cot) != 0:\n",
    "        answer_with_cot_num += 1\n",
    "        answer_with_cot_token_sum += len(tokenizer.tokenize(answer_with_cot[0]))\n",
    "\n",
    "    if \"Graph[name=\" in graph_language:\n",
    "        graph_language_num += 1\n",
    "        graph_language_token_sum += len(tokenizer.tokenize(graph_language))\n",
    "    \n",
    "    return {\n",
    "        \"task_name\": example[\"task_name\"],\n",
    "        \"instruction_num\": instruction_num,\n",
    "        \"instruction_token_sum\": instruction_token_sum,\n",
    "        \"answer_num\": answer_num,\n",
    "        \"answer_token_sum\": answer_token_sum,\n",
    "        \"answer_with_cot_num\": answer_with_cot_num,\n",
    "        \"answer_with_cot_token_sum\": answer_with_cot_token_sum,\n",
    "        \"instruction_plus_answer_num\": instruction_plus_answer_num,\n",
    "        \"instruction_plus_answer_token_sum\": instruction_plus_answer_token_sum,\n",
    "        \"graph_language_num\": graph_language_num,\n",
    "        \"graph_language_token_sum\": graph_language_token_sum,\n",
    "    }"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "id": "5380ace3",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████████████████████████| 1259710/1259710 [2:20:59<00:00, 148.91it/s]\n",
      "100%|████████████████████████████████████| 32668/32668 [02:20<00:00, 232.18it/s]\n"
     ]
    }
   ],
   "source": [
    "def analysis_token_length(data: list, window_size=200):\n",
    "\n",
    "    before_tokenization_token_info = list()\n",
    "    llama2_tokenization_token_info = list()\n",
    "    gpt2_tokenization_token_info = list()\n",
    "    flant5_tokenization_token_info = list()\n",
    "    \n",
    "    ## 获取每个样本的统计信息\n",
    "    for example in tqdm(data):\n",
    "        instruction = example[\"instruction\"]\n",
    "        answer = example[\"answer\"]\n",
    "        answer_with_cot = example[\"answer_with_cot\"]\n",
    "        graph_language = example[\"graph_language\"]\n",
    "        \n",
    "        # 当前样本，分词前的长度信息统计（以空格为分词）\n",
    "        before_tokenization_token_info.append(before_tokenization_statistic(example))\n",
    "        \n",
    "        # 当前样本，llama2分词后的长度信息统计\n",
    "        llama2_tokenization_token_info.append(after_tokenization_statistic(example, llama2_tokenizer))\n",
    "        \n",
    "# #         # 当前样本，llama2分词后的长度信息统计\n",
    "        gpt2_tokenization_token_info.append(after_tokenization_statistic(example, gpt2_tokenizer))\n",
    "        \n",
    "# #         # 当前样本，llama2分词后的长度信息统计\n",
    "        flant5_tokenization_token_info.append(after_tokenization_statistic(example, flant5_tokenizer))\n",
    "    \n",
    "    return {\n",
    "        \"before_tokenization_token_info\": before_tokenization_token_info,\n",
    "        \"llama2_tokenization_token_info\": llama2_tokenization_token_info,\n",
    "        \"gpt2_tokenization_token_info\": gpt2_tokenization_token_info,\n",
    "        \"flant5_tokenization_token_info\": flant5_tokenization_token_info,\n",
    "    }\n",
    "\n",
    "\n",
    "meta_train_token_info = analysis_token_length(instruction_train_data)\n",
    "meta_test_token_info = analysis_token_length(instruction_test_data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "6f865012",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████████████████████████████████| 4376/4376 [00:30<00:00, 141.58it/s]\n"
     ]
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "id": "1aafc7f3",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'task_name': 'graph-language-modeling-graph-caption-generation-genwiki', 'instruction_num': 1, 'instruction_token_sum': 112, 'answer_num': 1, 'answer_token_sum': 32, 'answer_with_cot_num': 0, 'answer_with_cot_token_sum': 0, 'instruction_plus_answer_num': 1, 'instruction_plus_answer_token_sum': 144, 'graph_language_num': 1, 'graph_language_token_sum': 29}\n",
      "{'task_name': 'graph-language-modeling-graph-question-answering-wc2014', 'instruction_num': 1, 'instruction_token_sum': 229, 'answer_num': 1, 'answer_token_sum': 1, 'answer_with_cot_num': 1, 'answer_with_cot_token_sum': 3, 'instruction_plus_answer_num': 1, 'instruction_plus_answer_token_sum': 230, 'graph_language_num': 1, 'graph_language_token_sum': 134}\n"
     ]
    }
   ],
   "source": [
    "print(meta_train_token_info[\"before_tokenization_token_info\"][23343])\n",
    "print(meta_test_token_info[\"before_tokenization_token_info\"][243])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "95389d50",
   "metadata": {},
   "source": [
    "**统计所有样本的平均长度**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 105,
   "id": "c8ed4eca",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|█████████████████████████████| 1259710/1259710 [00:12<00:00, 103027.52it/s]\n",
      "100%|█████████████████████████████| 1259710/1259710 [00:02<00:00, 446228.93it/s]\n",
      "100%|█████████████████████████████| 1259710/1259710 [00:02<00:00, 462371.03it/s]\n",
      "100%|█████████████████████████████| 1259710/1259710 [00:02<00:00, 475132.74it/s]\n",
      "100%|█████████████████████████████████| 32668/32668 [00:00<00:00, 194166.93it/s]\n",
      "100%|████████████████████████████████| 32668/32668 [00:00<00:00, 1063032.10it/s]\n",
      "100%|████████████████████████████████| 32668/32668 [00:00<00:00, 1103314.49it/s]\n",
      "100%|████████████████████████████████| 32668/32668 [00:00<00:00, 1119522.87it/s]\n"
     ]
    }
   ],
   "source": [
    "def overall_statistics(meta_token_info):\n",
    "    \n",
    "    overall_token_info = dict()\n",
    "    \n",
    "    for kind in [\"before\", \"llama2\", \"gpt2\", \"flant5\"]:\n",
    "        \n",
    "        instruction_token_num, instruction_token_sum = 0, 0\n",
    "        answer_token_num, answer_token_sum = 0, 0\n",
    "        answer_with_cot_token_num, answer_with_cot_token_sum = 0, 0\n",
    "        instruction_plus_answer_token_num, instruction_plus_answer_token_sum = 0, 0\n",
    "        graph_language_token_num, graph_language_token_sum = 0, 0\n",
    "        \n",
    "        max_instruction_plus_answer_token_sum = 0\n",
    "        max_i = 0\n",
    "        \n",
    "        over_length_num = 0 # 统计超越2000 token长度的样本数量\n",
    "\n",
    "        for ei, info in enumerate(tqdm(meta_token_info[\"{}_tokenization_token_info\".format(kind)])):\n",
    "            instruction_token_num += info[\"instruction_num\"]\n",
    "            instruction_token_sum += info[\"instruction_token_sum\"]\n",
    "            \n",
    "            answer_token_num += info[\"answer_num\"]\n",
    "            answer_token_sum += info[\"answer_token_sum\"]\n",
    "\n",
    "            answer_with_cot_token_num += info[\"answer_with_cot_num\"]\n",
    "            answer_with_cot_token_sum += info[\"answer_with_cot_token_sum\"]\n",
    "            \n",
    "            instruction_plus_answer_token_num += info[\"instruction_plus_answer_num\"]\n",
    "            instruction_plus_answer_token_sum += info[\"instruction_plus_answer_token_sum\"]\n",
    "\n",
    "            graph_language_token_num += info[\"graph_language_num\"]\n",
    "            graph_language_token_sum += info[\"graph_language_token_sum\"]\n",
    "            \n",
    "            if info[\"instruction_plus_answer_token_sum\"] > max_instruction_plus_answer_token_sum:\n",
    "                max_instruction_plus_answer_token_sum = info[\"instruction_plus_answer_token_sum\"]\n",
    "                max_i = ei\n",
    "            \n",
    "            if info[\"instruction_plus_answer_token_sum\"] > 2000:\n",
    "                over_length_num += 1\n",
    "        \n",
    "        avg_instruction_token_sum = round(instruction_token_sum / instruction_token_num, 4)\n",
    "        avg_answer_token_sum = round(answer_token_sum / answer_token_num, 4)\n",
    "        avg_answer_with_cot_token_sum = round(answer_with_cot_token_sum / answer_with_cot_token_num, 4)\n",
    "        avg_instruction_plus_answer_token_sum = round(instruction_plus_answer_token_sum / instruction_plus_answer_token_num, 4)\n",
    "        avg_graph_language_token_sum = round(graph_language_token_sum / graph_language_token_num, 4)\n",
    "        \n",
    "        overall_token_info[\"{}_tokenization\".format(kind)] = {\n",
    "            \"avg_instruction_token_sum\": avg_instruction_token_sum,\n",
    "            \"avg_answer_token_sum\": avg_answer_token_sum,\n",
    "            \"avg_answer_with_cot_token_sum\": avg_answer_with_cot_token_sum,\n",
    "            \"avg_instruction_plus_answer_token_sum\": avg_instruction_plus_answer_token_sum,\n",
    "            \"avg_graph_language_token_sum\": avg_graph_language_token_sum,\n",
    "            \"max_instruction_plus_answer_token_sum\": max_instruction_plus_answer_token_sum,\n",
    "            \"max_i\": max_i,\n",
    "            \"over_length_num\": over_length_num,\n",
    "        }\n",
    "    return overall_token_info\n",
    "\n",
    "train_overall_token_info, test_overall_token_info = overall_statistics(meta_train_token_info), overall_statistics(meta_test_token_info)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "id": "73dde8db",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'before_tokenization': {'avg_instruction_token_sum': 194.9669,\n",
       "  'avg_answer_token_sum': 36.5948,\n",
       "  'avg_answer_with_cot_token_sum': 5.8681,\n",
       "  'avg_instruction_plus_answer_token_sum': 231.5617,\n",
       "  'avg_graph_language_token_sum': 74.7743,\n",
       "  'max_instruction_plus_answer_token_sum': 401,\n",
       "  'max_i': 508,\n",
       "  'over_length_num': 0},\n",
       " 'llama2_tokenization': {'avg_instruction_token_sum': 413.3385,\n",
       "  'avg_answer_token_sum': 72.3072,\n",
       "  'avg_answer_with_cot_token_sum': 35.2151,\n",
       "  'avg_instruction_plus_answer_token_sum': 485.6457,\n",
       "  'avg_graph_language_token_sum': 273.6371,\n",
       "  'max_instruction_plus_answer_token_sum': 2543,\n",
       "  'max_i': 27206,\n",
       "  'over_length_num': 819},\n",
       " 'gpt2_tokenization': {'avg_instruction_token_sum': 394.5139,\n",
       "  'avg_answer_token_sum': 65.8861,\n",
       "  'avg_answer_with_cot_token_sum': 32.9232,\n",
       "  'avg_instruction_plus_answer_token_sum': 460.3999,\n",
       "  'avg_graph_language_token_sum': 259.5475,\n",
       "  'max_instruction_plus_answer_token_sum': 2085,\n",
       "  'max_i': 104420,\n",
       "  'over_length_num': 3},\n",
       " 'flant5_tokenization': {'avg_instruction_token_sum': 466.294,\n",
       "  'avg_answer_token_sum': 73.3569,\n",
       "  'avg_answer_with_cot_token_sum': 46.3874,\n",
       "  'avg_instruction_plus_answer_token_sum': 539.6509,\n",
       "  'avg_graph_language_token_sum': 323.5862,\n",
       "  'max_instruction_plus_answer_token_sum': 2240,\n",
       "  'max_i': 207539,\n",
       "  'over_length_num': 295}}"
      ]
     },
     "execution_count": 106,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_overall_token_info"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "id": "ab8b728d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'before_tokenization': {'avg_instruction_token_sum': 201.0852,\n",
       "  'avg_answer_token_sum': 21.096,\n",
       "  'avg_answer_with_cot_token_sum': 11.3186,\n",
       "  'avg_instruction_plus_answer_token_sum': 222.1812,\n",
       "  'avg_graph_language_token_sum': 93.7141,\n",
       "  'max_instruction_plus_answer_token_sum': 401,\n",
       "  'max_i': 811,\n",
       "  'over_length_num': 0},\n",
       " 'llama2_tokenization': {'avg_instruction_token_sum': 521.4099,\n",
       "  'avg_answer_token_sum': 47.6235,\n",
       "  'avg_answer_with_cot_token_sum': 43.5548,\n",
       "  'avg_instruction_plus_answer_token_sum': 569.0333,\n",
       "  'avg_graph_language_token_sum': 421.2474,\n",
       "  'max_instruction_plus_answer_token_sum': 2521,\n",
       "  'max_i': 8184,\n",
       "  'over_length_num': 79},\n",
       " 'gpt2_tokenization': {'avg_instruction_token_sum': 479.7712,\n",
       "  'avg_answer_token_sum': 44.5938,\n",
       "  'avg_answer_with_cot_token_sum': 38.4516,\n",
       "  'avg_instruction_plus_answer_token_sum': 524.3651,\n",
       "  'avg_graph_language_token_sum': 375.2111,\n",
       "  'max_instruction_plus_answer_token_sum': 1940,\n",
       "  'max_i': 3712,\n",
       "  'over_length_num': 0},\n",
       " 'flant5_tokenization': {'avg_instruction_token_sum': 562.8961,\n",
       "  'avg_answer_token_sum': 49.8125,\n",
       "  'avg_answer_with_cot_token_sum': 49.3623,\n",
       "  'avg_instruction_plus_answer_token_sum': 612.7086,\n",
       "  'avg_graph_language_token_sum': 454.717,\n",
       "  'max_instruction_plus_answer_token_sum': 2187,\n",
       "  'max_i': 3712,\n",
       "  'over_length_num': 35}}"
      ]
     },
     "execution_count": 107,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_overall_token_info"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "id": "aa0109fd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'task_name': 'graph-language-modeling-graph-caption-generation-wikipedia',\n",
       " 'idx': 131215,\n",
       " 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikipedia-knowledge-graph\"] {\\n    entity_list = [\\'track cyclist\\', \\'team sprint\\', \\'miroslav minchev\\', \\'time trial\\', \\'competed\\', \\'2016 uec european track championships\\', \\'17 january\\', \\'international\\', \\'bulgaria\\'];\\n    triple_list = [(\"team sprint\" -> \"track cyclist\")[relation=\"sport\"], (\"time trial\" -> \"track cyclist\")[relation=\"sport\"], (\"2016 uec european track championships\" -> \"track cyclist\")[relation=\"sport\"]];\\n}\\n```\\nTask definition: given a knowledge graph with all entities and structure triples representing factual and commonsense knowledge. Please leverage this graph to generate an encyclopedia passage. Note that do not list all knowledge in a running account.\\nQ: Please generate an encyclopedia passage for the knowledge graph.\\nA:',\n",
       " 'graph_language': '```\\nGraph[name=\"wikipedia-knowledge-graph\"] {\\n    entity_list = [\\'track cyclist\\', \\'team sprint\\', \\'miroslav minchev\\', \\'time trial\\', \\'competed\\', \\'2016 uec european track championships\\', \\'17 january\\', \\'international\\', \\'bulgaria\\'];\\n    triple_list = [(\"team sprint\" -> \"track cyclist\")[relation=\"sport\"], (\"time trial\" -> \"track cyclist\")[relation=\"sport\"], (\"2016 uec european track championships\" -> \"track cyclist\")[relation=\"sport\"]];\\n}\\n```',\n",
       " 'graph': {'node_list': ['track cyclist',\n",
       "   'team sprint',\n",
       "   'miroslav minchev',\n",
       "   'time trial',\n",
       "   'competed',\n",
       "   '2016 uec european track championships',\n",
       "   '17 january',\n",
       "   'international',\n",
       "   'bulgaria'],\n",
       "  'edge_list': [['team sprint', 'sport', 'track cyclist'],\n",
       "   ['time trial', 'sport', 'track cyclist'],\n",
       "   ['2016 uec european track championships', 'sport', 'track cyclist']]},\n",
       " 'answer': ['Miroslav Minchev (born 17 January 1989) is a Bulgarian male track cyclist, representing Bulgaria at international competitions. He competed at the 2016 UEC European Track Championships in the team sprint event and the 1km time trial event.'],\n",
       " 'answer_with_cot': [],\n",
       " 'difficulty': 'medium',\n",
       " 'from': 'Wikipedia-Wikidata5M'}"
      ]
     },
     "execution_count": 110,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "instruction_train_data[504830]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1a40173d",
   "metadata": {},
   "source": [
    "## 三、从训练集中进行采样，得到的样本用于调用ChatGPT获得CoT\n",
    "采样的任务：\n",
    "- graph structure modeling\n",
    "- graph language modeling\n",
    "条件：只采样数据集本身没有提供cot的\n",
    "采样样本数量：50,000。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "30b75e25",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "before sampling: 1457122\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      " 92%|███████████████████████████▍  | 1335036/1457122 [01:17<00:07, 17163.89it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "after sampling: 20000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "def sample_for_cot_generation(data: list, N: int=20000):\n",
    "    shuffle(data)\n",
    "    for_cot_data = list()\n",
    "    # 采样前的样本数量\n",
    "    print(\"before sampling: {}\".format(len(data)))\n",
    "    for example in tqdm(data):\n",
    "        if len(for_cot_data) >= N:\n",
    "            break\n",
    "        task_name = example[\"task_name\"]\n",
    "        instruction = example[\"instruction\"]\n",
    "#         answer_with_cot = example[\"answer_with_cot\"]\n",
    "        if len(instruction.split(\" \")) > 350:\n",
    "            continue\n",
    "        if \"graph-caption-generation\" in task_name:\n",
    "            # 这个任务不需要进行推理\n",
    "            continue\n",
    "        if \"graph-structure-modeling\" in task_name:\n",
    "            if random.random() < 0.7:\n",
    "                for_cot_data.append(example)\n",
    "        elif \"graph-language-modeling\" in task_name:\n",
    "            if random.random() < 0.04:\n",
    "                for_cot_data.append(example)\n",
    "    print(\"after sampling: {}\".format(len(for_cot_data)))\n",
    "    return for_cot_data\n",
    "                \n",
    "instruction_train_data_forcot = sample_for_cot_generation(instruction_train_data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "dc585957",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'task_name': 'graph-language-modeling-graph-link-prediction-wikidata5m',\n",
       " 'idx': 51057,\n",
       " 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'Trisector\\', \\'concert album\\', \\'1990s prog rock\\', \\'Cerniw\\', \\'audio album\\', \\'Van der Graaf generator (band)\\', \\'virgin records\\', \\'Present (Van der Graaf Generator album)\\', \\'a grounding in numbers\\', \\'Real Time (Van der Graaf Generator album)\\'];\\n    triple_list = [(\"Real Time (Van der Graaf Generator album)\" -> \"Present (Van der Graaf Generator album)\")[relation=\"follows\"], (\"Real Time (Van der Graaf Generator album)\" -> \"Van der Graaf generator (band)\")[relation=\"performer\"], (\"Real Time (Van der Graaf Generator album)\" -> \"concert album\")[relation=\"instance of\"], (\"Trisector\" -> \"virgin records\")[relation=\"record label\"], (\"Trisector\" -> \"a grounding in numbers\")[relation=\"followed by\"], (\"Trisector\" -> \"Van der Graaf generator (band)\")[relation=\"performer\"], (\"Trisector\" -> \"audio album\")[relation=\"instance of\"], (\"Trisector\" -> \"1990s prog rock\")[relation=\"genre\"], (\"Trisector\" -> \"Cerniw\")[relation=\"recorded at\"]];;\\n    head_entity = \"Trisector\";\\n    tail_entity = \"Cerniw\";\\n}\\n```\\nTask definition: given one head entity and tail entity and corresponding one-hop knowledge sub-graph, classify the relation between head entity and tail entity into one of \"recorded at\", \"highest point\", \"radix\", \"intangible cultural heritage status\", \"has part\", \"means of locomotion\", \"instance of\", \"followed by\", \"performer\", \"record label\", \"criterion used\", \"follows\", \"genre\".\\nQ: Please classify the relation between head entity and tail entity.\\nA:',\n",
       " 'graph_language': '```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'Trisector\\', \\'concert album\\', \\'1990s prog rock\\', \\'Cerniw\\', \\'audio album\\', \\'Van der Graaf generator (band)\\', \\'virgin records\\', \\'Present (Van der Graaf Generator album)\\', \\'a grounding in numbers\\', \\'Real Time (Van der Graaf Generator album)\\'];\\n    triple_list = [(\"Real Time (Van der Graaf Generator album)\" -> \"Present (Van der Graaf Generator album)\")[relation=\"follows\"], (\"Real Time (Van der Graaf Generator album)\" -> \"Van der Graaf generator (band)\")[relation=\"performer\"], (\"Real Time (Van der Graaf Generator album)\" -> \"concert album\")[relation=\"instance of\"], (\"Trisector\" -> \"virgin records\")[relation=\"record label\"], (\"Trisector\" -> \"a grounding in numbers\")[relation=\"followed by\"], (\"Trisector\" -> \"Van der Graaf generator (band)\")[relation=\"performer\"], (\"Trisector\" -> \"audio album\")[relation=\"instance of\"], (\"Trisector\" -> \"1990s prog rock\")[relation=\"genre\"], (\"Trisector\" -> \"Cerniw\")[relation=\"recorded at\"]];;\\n    head_entity = \"Trisector\";\\n    tail_entity = \"Cerniw\";\\n}\\n```',\n",
       " 'graph': {'node_list': ['Trisector',\n",
       "   'concert album',\n",
       "   '1990s prog rock',\n",
       "   'Cerniw',\n",
       "   'audio album',\n",
       "   'Van der Graaf generator (band)',\n",
       "   'virgin records',\n",
       "   'Present (Van der Graaf Generator album)',\n",
       "   'a grounding in numbers',\n",
       "   'Real Time (Van der Graaf Generator album)'],\n",
       "  'edge_list': [('Real Time (Van der Graaf Generator album)',\n",
       "    'follows',\n",
       "    'Present (Van der Graaf Generator album)'),\n",
       "   ('Real Time (Van der Graaf Generator album)',\n",
       "    'performer',\n",
       "    'Van der Graaf generator (band)'),\n",
       "   ('Real Time (Van der Graaf Generator album)',\n",
       "    'instance of',\n",
       "    'concert album'),\n",
       "   ('Trisector', 'record label', 'virgin records'),\n",
       "   ('Trisector', 'followed by', 'a grounding in numbers'),\n",
       "   ('Trisector', 'performer', 'Van der Graaf generator (band)'),\n",
       "   ('Trisector', 'instance of', 'audio album'),\n",
       "   ('Trisector', 'genre', '1990s prog rock'),\n",
       "   ('Trisector', 'recorded at', 'Cerniw')]},\n",
       " 'answer': ['followed by'],\n",
       " 'answer_with_cot': [],\n",
       " 'difficulty': 'medium',\n",
       " 'from': 'Wikidata5M'}"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "instruction_train_data_forcot[14804]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "7e316550",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 保存用于cot的数据\n",
    "np.save(\"instruction_dataset/instruction_train_data_forcot.npy\", instruction_train_data_forcot)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "1b6266bf",
   "metadata": {},
   "outputs": [],
   "source": [
    "# # 保存instruction训练数据集\n",
    "# np.save(\"instruction_dataset/released/instruction_train_data.npy\", instruction_train_data)\n",
    "# np.save(\"instruction_dataset/released/instruction_train_data_small.npy\", instruction_train_data_small)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "2b6dba6c",
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "class NpEncoder(json.JSONEncoder):\n",
    "    def default(self, obj):\n",
    "        if isinstance(obj, np.integer):\n",
    "            return int(obj)\n",
    "        if isinstance(obj, np.floating):\n",
    "            return float(obj)\n",
    "        if isinstance(obj, np.ndarray):\n",
    "            return obj.tolist()\n",
    "        return json.JSONEncoder.default(self, obj)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "4eef2909",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|███████████████████████████████| 1457122/1457122 [09:48<00:00, 2473.95it/s]\n"
     ]
    }
   ],
   "source": [
    "with open(\"instruction_dataset/released/instructgraph_train_data.json\", \"w\", encoding=\"utf-8\") as fw:\n",
    "    for example in tqdm(instruction_train_data):\n",
    "#         for key, values in example.items():\n",
    "#             if type(values) not in [str, list, int, dict]:\n",
    "#                 print(key)\n",
    "        fw.write(json.dumps(example, cls=NpEncoder) + \"\\n\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "49c95f6f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'111222'"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(\n",
    "    \"111\"\n",
    "    \"222\"\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ed02e769",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "85ce7ad6",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|███████████████████████████████████| 38822/38822 [00:06<00:00, 5902.79it/s]\n"
     ]
    }
   ],
   "source": [
    "with open(\"instruction_dataset/released/instructgraph_test_data.json\", \"w\", encoding=\"utf-8\") as fw:\n",
    "    for example in tqdm(instruction_test_data):\n",
    "#         for key, values in example.items():\n",
    "#             if type(values) not in [str, list, int, dict]:\n",
    "#                 print(key)\n",
    "        fw.write(json.dumps(example, cls=NpEncoder) + \"\\n\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "ec9ea182",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|█████████████████████████████████| 145671/145671 [01:06<00:00, 2183.27it/s]\n"
     ]
    }
   ],
   "source": [
    "with open(\"instruction_dataset/released/instructgraph_train_data_small.json\", \"w\", encoding=\"utf-8\") as fw:\n",
    "    for example in tqdm(instruction_train_data_small):\n",
    "#         for key, values in example.items():\n",
    "#             if type(values) not in [str, list, int, dict]:\n",
    "#                 print(key)\n",
    "        fw.write(json.dumps(example, cls=NpEncoder) + \"\\n\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "b1eb85a2",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|█████████████████████████████████████| 3892/3892 [00:00<00:00, 4915.72it/s]\n"
     ]
    }
   ],
   "source": [
    "with open(\"instruction_dataset/released/instructgraph_test_data_small.json\", \"w\", encoding=\"utf-8\") as fw:\n",
    "    for example in tqdm(instruction_test_data_small):\n",
    "#         for key, values in example.items():\n",
    "#             if type(values) not in [str, list, int, dict]:\n",
    "#                 print(key)\n",
    "        fw.write(json.dumps(example, cls=NpEncoder) + \"\\n\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "9f8a1de2",
   "metadata": {},
   "outputs": [],
   "source": [
    "instruction_train_data_mini = instruction_train_data_small\n",
    "shuffle(instruction_train_data_mini)\n",
    "instruction_train_data_mini = instruction_train_data_mini[:2000]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "62605b66",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|█████████████████████████████████████| 2000/2000 [00:00<00:00, 2146.50it/s]\n"
     ]
    }
   ],
   "source": [
    "with open(\"instruction_dataset/released/instructgraph_train_data_mini.json\", \"w\", encoding=\"utf-8\") as fw:\n",
    "    for example in tqdm(instruction_train_data_mini):\n",
    "#         for key, values in example.items():\n",
    "#             if type(values) not in [str, list, int, dict]:\n",
    "#                 print(key)\n",
    "        fw.write(json.dumps(example, cls=NpEncoder) + \"\\n\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "5d63daaa",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\n",
      "Note: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \n",
      "```\n",
      "Graph[name=\"citeseer-scientific-publications-citation-graph\"] {\n",
      "    publication_node_list = [\"paper_3008\", \"paper_3009\"];\n",
      "    publication_node_feature = [\"paper_3009\".category=\"IR\"];\n",
      "    target_publication_node = \"paper_3008\";\n",
      "    citation_triple_list = [(\"paper_3008\" -> \"paper_3009\")];\n",
      "}\n",
      "```\n",
      "Task definition: given a target scientific publication and corresponding citation graph, classify the target scientific publication into one of six categories, such as 'AI', 'Agents', 'DB', 'HCI', 'IR', and 'ML'.\n",
      "Q: Please classify the target scientific publication.\n",
      "A:\n",
      "['IR']\n"
     ]
    }
   ],
   "source": [
    "print(instruction_test_data[15700][\"instruction\"])\n",
    "print(instruction_test_data[15700][\"answer\"])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d8a23e9c",
   "metadata": {},
   "source": [
    "## 三、对测试集进行处理\n",
    "转换为task dict形式"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "9b30e1e3",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████████████████████████████| 32645/32645 [00:00<00:00, 32662.27it/s]\n",
      "100%|██████████████████████████████████| 3276/3276 [00:00<00:00, 1147148.10it/s]\n"
     ]
    }
   ],
   "source": [
    "def test_dict(data):\n",
    "    task_name2data_dict = dict()\n",
    "    for example in tqdm(data):\n",
    "        task_name = example[\"task_name\"]\n",
    "        if task_name not in task_name2data_dict.keys():\n",
    "            task_name2data_dict[task_name] = list()\n",
    "        task_name2data_dict[task_name].append(example)\n",
    "    return task_name2data_dict\n",
    "\n",
    "instruction_test_data_dict, instruction_test_data_dict_small = test_dict(instruction_test_data), test_dict(instruction_test_data_small)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "c0cd0484",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 保存instruction测试数据集\n",
    "np.save(\"instruction_dataset/released/instruction_test_data.npy\", instruction_test_data_dict)\n",
    "np.save(\"instruction_dataset/released/instruction_test_data_small.npy\", instruction_test_data_dict_small)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "82e0f34a",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "408b5747",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 144,
   "id": "edee8ac3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.04"
      ]
     },
     "execution_count": 144,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "50000/1250000"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "553e253a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "181.28"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "## 1年\n",
    "# meituan\n",
    "7 + 3.53*15.5 # 61.715\n",
    "\n",
    "# ant\n",
    "20 + 3.36*16 # 73.76\n",
    "\n",
    "# tencent\n",
    "6 + 2.8*17 + 4.8 + 30 # 88.40\n",
    "\n",
    "## 3年\n",
    "\n",
    "#meituan:\n",
    "7 + 3.53*15.5*3 # 171.145w + 70w = 241\n",
    "\n",
    "#ant \n",
    "20 + 3.36*16*3 # 181.28 + 10w = 190\n",
    "\n",
    "# tencent\n",
    "6 + 2.8*17*3 + 4.8*3 + 90 = 253.2\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 116,
   "id": "4fa456c1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "85.6"
      ]
     },
     "execution_count": 116,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "6 + 2.8*16 + 4.8 + 30 # 88.40"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 131,
   "id": "bfb840cb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "28717.92"
      ]
     },
     "execution_count": 131,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "2393.16*2*6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "id": "3fd5f921",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "36107.47"
      ]
     },
     "execution_count": 107,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "34398.47 + 1709"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 108,
   "id": "2e0922b7",
   "metadata": {},
   "outputs": [],
   "source": [
    "instruction_train_data_with_cot = list()\n",
    "if os.path.exists(\"instruction_dataset/released/instruction_train_data_with_cot.npy\"):\n",
    "    instruction_train_data_with_cot = np.load(\"instruction_dataset/released/instruction_train_data_with_cot.npy\", allow_pickle=True)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 109,
   "id": "ef3796b5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "225"
      ]
     },
     "execution_count": 109,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(instruction_train_data_with_cot)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "id": "6ff6569e",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([{'task_name': 'graph-structure-modeling-graph-connectivity-detection-nlgraph', 'idx': 1056, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"connectivity-detection\"] {\\n    node_list = [1, 3, 5];\\n    edge_list = [(1 <-> 5), (3 <-> 5)];\\n}\\n```\\nTask definition: determine if there is a path between two nodes in the graph.\\nQ: Is there a path between node 0 and node 1? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"connectivity-detection\"] {\\n    node_list = [1, 3, 5];\\n    edge_list = [(1 <-> 5), (3 <-> 5)];\\n}\\n```', 'graph': {'node_list': [1, 3, 5], 'edge_list': [('1', '5'), ('3', '5')]}, 'answer': ['The answer is no.'], 'answer_with_cot': ['There is no information provided about node 0 in the given graph, so we cannot determine if there is a path between node 0 and node 1.'], 'difficulty': 'easy', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-language-modeling-graph-node-cls-ogbn-products', 'idx': 5489, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"product-graph\"] {\\n    product_node_list = [\"B00IL7BG98\", \"B00BJN74OM\", \"B00IL7BG5C\", \"B00IJ1H9LK\", \"B00FK5V414\", \"B00J4EYZDQ\", \"B009S0ZQPM\", \"B00IL7BGYI\", \"B00J4EZFFI\", \"B00DQYL72W\", \"B00BQM36XE\", \"B00JUMEQAE\", \"B00DDLYCUW\", \"B00ESL6SKI\", \"B00F3SIQKK\", \"B00G29DIZ2\", \"B00ESYW40S\", \"B00974L4GO\", \"B00IR2QA02\", \"B00HYSFRWM\", \"B00GM5QU1K\", \"B008U6PZO2\", \"B00FAADBHO\", \"B00BFM4SIW\", \"B00CPQOKRQ\", \"B00CGF1Q3C\", \"B00H392KXG\", \"B00AOCUP6S\", \"B00C2HQWWE\", \"B00E1NFZQG\", \"B00J9A8CFC\"];\\n    product_node_feature = [\"B00BJN74OM\".category=\"Cell.Phones.&.Accessories\", \"B00IL7BG5C\".category=\"Cell.Phones.&.Accessories\", \"B00IJ1H9LK\".category=\"Electronics\", \"B00FK5V414\".category=\"Cell.Phones.&.Accessories\", \"B00J4EYZDQ\".category=\"Cell.Phones.&.Accessories\", \"B009S0ZQPM\".category=\"Electronics\", \"B00IL7BGYI\".category=\"Cell.Phones.&.Accessories\", \"B00J4EZFFI\".category=\"Cell.Phones.&.Accessories\", \"B00DQYL72W\".category=\"Cell.Phones.&.Accessories\", \"B00BQM36XE\".category=\"Cell.Phones.&.Accessories\", \"B00JUMEQAE\".category=\"Cell.Phones.&.Accessories\", \"B00DDLYCUW\".category=\"Cell.Phones.&.Accessories\", \"B00ESL6SKI\".category=\"Cell.Phones.&.Accessories\", \"B00F3SIQKK\".category=\"Cell.Phones.&.Accessories\", \"B00G29DIZ2\".category=\"Cell.Phones.&.Accessories\", \"B00ESYW40S\".category=\"Electronics\", \"B00974L4GO\".category=\"Cell.Phones.&.Accessories\", \"B00IR2QA02\".category=\"Cell.Phones.&.Accessories\", \"B00HYSFRWM\".category=\"Cell.Phones.&.Accessories\", \"B00GM5QU1K\".category=\"\", \"B008U6PZO2\".category=\"Cell.Phones.&.Accessories\", \"B00FAADBHO\".category=\"Cell.Phones.&.Accessories\", \"B00BFM4SIW\".category=\"Cell.Phones.&.Accessories\", \"B00CPQOKRQ\".category=\"Cell.Phones.&.Accessories\", \"B00CGF1Q3C\".category=\"\", \"B00H392KXG\".category=\"Cell.Phones.&.Accessories\", \"B00AOCUP6S\".category=\"Cell.Phones.&.Accessories\", \"B00C2HQWWE\".category=\"Electronics\", \"B00E1NFZQG\".category=\"\", \"B00J9A8CFC\".category=\"Cell.Phones.&.Accessories\"];\\n    product_triple_list = [(\"B00IL7BG98\" -> \"B00BJN74OM\"), (\"B00IL7BG98\" -> \"B00IL7BG5C\"), (\"B00IJ1H9LK\" -> \"B00FK5V414\"), (\"B00IL7BG5C\" -> \"B00J4EYZDQ\"), (\"B00IJ1H9LK\" -> \"B009S0ZQPM\"), (\"B00IL7BG98\" -> \"B00IJ1H9LK\"), (\"B00IL7BG5C\" -> \"B00IL7BGYI\"), (\"B00IL7BG5C\" -> \"B00J4EZFFI\"), (\"B00BJN74OM\" -> \"B00DQYL72W\"), (\"B00BJN74OM\" -> \"B00BQM36XE\"), (\"B00IJ1H9LK\" -> \"B00JUMEQAE\"), (\"B00DDLYCUW\" -> \"B00ESL6SKI\"), (\"B00BJN74OM\" -> \"B00F3SIQKK\"), (\"B00BJN74OM\" -> \"B00G29DIZ2\"), (\"B00IL7BG5C\" -> \"B00ESYW40S\"), (\"B00974L4GO\" -> \"B00IR2QA02\"), (\"B00974L4GO\" -> \"B00HYSFRWM\"), (\"B00DDLYCUW\" -> \"B00GM5QU1K\"), (\"B00974L4GO\" -> \"B008U6PZO2\"), (\"B00DDLYCUW\" -> \"B00FAADBHO\"), (\"B00BJN74OM\" -> \"B00BFM4SIW\"), (\"B00974L4GO\" -> \"B00CPQOKRQ\"), (\"B00IJ1H9LK\" -> \"B00CGF1Q3C\"), (\"B00DDLYCUW\" -> \"B00H392KXG\"), (\"B00IL7BG98\" -> \"B00974L4GO\"), (\"B00IL7BG5C\" -> \"B00AOCUP6S\"), (\"B00DDLYCUW\" -> \"B00C2HQWWE\"), (\"B00IL7BG98\" -> \"B00DDLYCUW\"), (\"B00974L4GO\" -> \"B00E1NFZQG\"), (\"B00IJ1H9LK\" -> \"B00J9A8CFC\")];\\n    target_product_node = \"B00IL7BG98\";\\n}\\n```\\nTask definition: given a product and corresponding graph, classify the target product into one of Clothing,.Shoes.&.Jewelry, Gift.Cards, Kitchen.&.Dining, Books, Tools.&.Home.Improvement, , CDs.&.Vinyl, Cell.Phones.&.Accessories, #508510, Industrial.&.Scientific.\\nQ: Please classify the target product. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"product-graph\"] {\\n    product_node_list = [\"B00IL7BG98\", \"B00BJN74OM\", \"B00IL7BG5C\", \"B00IJ1H9LK\", \"B00FK5V414\", \"B00J4EYZDQ\", \"B009S0ZQPM\", \"B00IL7BGYI\", \"B00J4EZFFI\", \"B00DQYL72W\", \"B00BQM36XE\", \"B00JUMEQAE\", \"B00DDLYCUW\", \"B00ESL6SKI\", \"B00F3SIQKK\", \"B00G29DIZ2\", \"B00ESYW40S\", \"B00974L4GO\", \"B00IR2QA02\", \"B00HYSFRWM\", \"B00GM5QU1K\", \"B008U6PZO2\", \"B00FAADBHO\", \"B00BFM4SIW\", \"B00CPQOKRQ\", \"B00CGF1Q3C\", \"B00H392KXG\", \"B00AOCUP6S\", \"B00C2HQWWE\", \"B00E1NFZQG\", \"B00J9A8CFC\"];\\n    product_node_feature = [\"B00BJN74OM\".category=\"Cell.Phones.&.Accessories\", \"B00IL7BG5C\".category=\"Cell.Phones.&.Accessories\", \"B00IJ1H9LK\".category=\"Electronics\", \"B00FK5V414\".category=\"Cell.Phones.&.Accessories\", \"B00J4EYZDQ\".category=\"Cell.Phones.&.Accessories\", \"B009S0ZQPM\".category=\"Electronics\", \"B00IL7BGYI\".category=\"Cell.Phones.&.Accessories\", \"B00J4EZFFI\".category=\"Cell.Phones.&.Accessories\", \"B00DQYL72W\".category=\"Cell.Phones.&.Accessories\", \"B00BQM36XE\".category=\"Cell.Phones.&.Accessories\", \"B00JUMEQAE\".category=\"Cell.Phones.&.Accessories\", \"B00DDLYCUW\".category=\"Cell.Phones.&.Accessories\", \"B00ESL6SKI\".category=\"Cell.Phones.&.Accessories\", \"B00F3SIQKK\".category=\"Cell.Phones.&.Accessories\", \"B00G29DIZ2\".category=\"Cell.Phones.&.Accessories\", \"B00ESYW40S\".category=\"Electronics\", \"B00974L4GO\".category=\"Cell.Phones.&.Accessories\", \"B00IR2QA02\".category=\"Cell.Phones.&.Accessories\", \"B00HYSFRWM\".category=\"Cell.Phones.&.Accessories\", \"B00GM5QU1K\".category=\"\", \"B008U6PZO2\".category=\"Cell.Phones.&.Accessories\", \"B00FAADBHO\".category=\"Cell.Phones.&.Accessories\", \"B00BFM4SIW\".category=\"Cell.Phones.&.Accessories\", \"B00CPQOKRQ\".category=\"Cell.Phones.&.Accessories\", \"B00CGF1Q3C\".category=\"\", \"B00H392KXG\".category=\"Cell.Phones.&.Accessories\", \"B00AOCUP6S\".category=\"Cell.Phones.&.Accessories\", \"B00C2HQWWE\".category=\"Electronics\", \"B00E1NFZQG\".category=\"\", \"B00J9A8CFC\".category=\"Cell.Phones.&.Accessories\"];\\n    product_triple_list = [(\"B00IL7BG98\" -> \"B00BJN74OM\"), (\"B00IL7BG98\" -> \"B00IL7BG5C\"), (\"B00IJ1H9LK\" -> \"B00FK5V414\"), (\"B00IL7BG5C\" -> \"B00J4EYZDQ\"), (\"B00IJ1H9LK\" -> \"B009S0ZQPM\"), (\"B00IL7BG98\" -> \"B00IJ1H9LK\"), (\"B00IL7BG5C\" -> \"B00IL7BGYI\"), (\"B00IL7BG5C\" -> \"B00J4EZFFI\"), (\"B00BJN74OM\" -> \"B00DQYL72W\"), (\"B00BJN74OM\" -> \"B00BQM36XE\"), (\"B00IJ1H9LK\" -> \"B00JUMEQAE\"), (\"B00DDLYCUW\" -> \"B00ESL6SKI\"), (\"B00BJN74OM\" -> \"B00F3SIQKK\"), (\"B00BJN74OM\" -> \"B00G29DIZ2\"), (\"B00IL7BG5C\" -> \"B00ESYW40S\"), (\"B00974L4GO\" -> \"B00IR2QA02\"), (\"B00974L4GO\" -> \"B00HYSFRWM\"), (\"B00DDLYCUW\" -> \"B00GM5QU1K\"), (\"B00974L4GO\" -> \"B008U6PZO2\"), (\"B00DDLYCUW\" -> \"B00FAADBHO\"), (\"B00BJN74OM\" -> \"B00BFM4SIW\"), (\"B00974L4GO\" -> \"B00CPQOKRQ\"), (\"B00IJ1H9LK\" -> \"B00CGF1Q3C\"), (\"B00DDLYCUW\" -> \"B00H392KXG\"), (\"B00IL7BG98\" -> \"B00974L4GO\"), (\"B00IL7BG5C\" -> \"B00AOCUP6S\"), (\"B00DDLYCUW\" -> \"B00C2HQWWE\"), (\"B00IL7BG98\" -> \"B00DDLYCUW\"), (\"B00974L4GO\" -> \"B00E1NFZQG\"), (\"B00IJ1H9LK\" -> \"B00J9A8CFC\")];\\n    target_product_node = \"B00IL7BG98\";\\n}\\n```', 'graph': {'node_list': ['B00IL7BG98', 'B00BJN74OM', 'B00IL7BG5C', 'B00IJ1H9LK', 'B00FK5V414', 'B00J4EYZDQ', 'B009S0ZQPM', 'B00IL7BGYI', 'B00J4EZFFI', 'B00DQYL72W', 'B00BQM36XE', 'B00JUMEQAE', 'B00DDLYCUW', 'B00ESL6SKI', 'B00F3SIQKK', 'B00G29DIZ2', 'B00ESYW40S', 'B00974L4GO', 'B00IR2QA02', 'B00HYSFRWM', 'B00GM5QU1K', 'B008U6PZO2', 'B00FAADBHO', 'B00BFM4SIW', 'B00CPQOKRQ', 'B00CGF1Q3C', 'B00H392KXG', 'B00AOCUP6S', 'B00C2HQWWE', 'B00E1NFZQG', 'B00J9A8CFC'], 'edge_list': [('B00IL7BG98', 'B00BJN74OM'), ('B00IL7BG98', 'B00IL7BG5C'), ('B00IJ1H9LK', 'B00FK5V414'), ('B00IL7BG5C', 'B00J4EYZDQ'), ('B00IJ1H9LK', 'B009S0ZQPM'), ('B00IL7BG98', 'B00IJ1H9LK'), ('B00IL7BG5C', 'B00IL7BGYI'), ('B00IL7BG5C', 'B00J4EZFFI'), ('B00BJN74OM', 'B00DQYL72W'), ('B00BJN74OM', 'B00BQM36XE'), ('B00IJ1H9LK', 'B00JUMEQAE'), ('B00DDLYCUW', 'B00ESL6SKI'), ('B00BJN74OM', 'B00F3SIQKK'), ('B00BJN74OM', 'B00G29DIZ2'), ('B00IL7BG5C', 'B00ESYW40S'), ('B00974L4GO', 'B00IR2QA02'), ('B00974L4GO', 'B00HYSFRWM'), ('B00DDLYCUW', 'B00GM5QU1K'), ('B00974L4GO', 'B008U6PZO2'), ('B00DDLYCUW', 'B00FAADBHO'), ('B00BJN74OM', 'B00BFM4SIW'), ('B00974L4GO', 'B00CPQOKRQ'), ('B00IJ1H9LK', 'B00CGF1Q3C'), ('B00DDLYCUW', 'B00H392KXG'), ('B00IL7BG98', 'B00974L4GO'), ('B00IL7BG5C', 'B00AOCUP6S'), ('B00DDLYCUW', 'B00C2HQWWE'), ('B00IL7BG98', 'B00DDLYCUW'), ('B00974L4GO', 'B00E1NFZQG'), ('B00IJ1H9LK', 'B00J9A8CFC')], 'node_feature': {'B00BJN74OM': {'label': 'Cell.Phones.&.Accessories'}, 'B00IL7BG5C': {'label': 'Cell.Phones.&.Accessories'}, 'B00IJ1H9LK': {'label': 'Electronics'}, 'B00FK5V414': {'label': 'Cell.Phones.&.Accessories'}, 'B00J4EYZDQ': {'label': 'Cell.Phones.&.Accessories'}, 'B009S0ZQPM': {'label': 'Electronics'}, 'B00IL7BGYI': {'label': 'Cell.Phones.&.Accessories'}, 'B00J4EZFFI': {'label': 'Cell.Phones.&.Accessories'}, 'B00DQYL72W': {'label': 'Cell.Phones.&.Accessories'}, 'B00BQM36XE': {'label': 'Cell.Phones.&.Accessories'}, 'B00JUMEQAE': {'label': 'Cell.Phones.&.Accessories'}, 'B00DDLYCUW': {'label': 'Cell.Phones.&.Accessories'}, 'B00ESL6SKI': {'label': 'Cell.Phones.&.Accessories'}, 'B00F3SIQKK': {'label': 'Cell.Phones.&.Accessories'}, 'B00G29DIZ2': {'label': 'Cell.Phones.&.Accessories'}, 'B00ESYW40S': {'label': 'Electronics'}, 'B00974L4GO': {'label': 'Cell.Phones.&.Accessories'}, 'B00IR2QA02': {'label': 'Cell.Phones.&.Accessories'}, 'B00HYSFRWM': {'label': 'Cell.Phones.&.Accessories'}, 'B00GM5QU1K': {'label': ''}, 'B008U6PZO2': {'label': 'Cell.Phones.&.Accessories'}, 'B00FAADBHO': {'label': 'Cell.Phones.&.Accessories'}, 'B00BFM4SIW': {'label': 'Cell.Phones.&.Accessories'}, 'B00CPQOKRQ': {'label': 'Cell.Phones.&.Accessories'}, 'B00CGF1Q3C': {'label': ''}, 'B00H392KXG': {'label': 'Cell.Phones.&.Accessories'}, 'B00AOCUP6S': {'label': 'Cell.Phones.&.Accessories'}, 'B00C2HQWWE': {'label': 'Electronics'}, 'B00E1NFZQG': {'label': ''}, 'B00J9A8CFC': {'label': 'Cell.Phones.&.Accessories'}}}, 'answer': ['Cell.Phones.&.Accessories'], 'answer_with_cot': ['To classify the target product, we need to determine its category based on the graph information provided. First, let\\'s examine the connections of the target product \"B00IL7BG98\" in the graph:\\n\\n- (B00IL7BG98 -> B00BJN74OM)\\n- (B00IL7BG98 -> B00IL7BG5C)\\n- (B00IL7BG98 -> B00IJ1H9LK)\\n- (B00IL7BG98 -> B00974L4GO)\\n- (B00IL7BG98 -> B00AOCUP6S)\\n- (B00IL7BG98 -> B00974L4GO)\\n- (B00IL7BG98 -> B00DDLYCUW)\\n- (B00IL7BG98 -> B00E1NFZQG)\\n\\nBased on the connections, we can see that B00IL7BG98 is linked to several other nodes via directed edges. Now, let\\'s look at the categories of these connected nodes:\\n\\n- B00BJN74OM.category: Cell.Phones.&.Accessories\\n- B00IL7BG5C.category: Cell.Phones.&.Accessories\\n- B00IJ1H9LK.category: Electronics\\n- B00974L4GO.category: Cell.Phones.&.Accessories\\n- B00AOCUP6S.category: Cell.Phones.&.Accessories\\n- B00974L4GO.category: Cell.Phones.&.Accessories\\n- B00DDLYCUW.category: Cell.Phones.&.Accessories\\n- B00E1NFZQG.category: \\n\\nFrom the categories of the connected nodes, we can conclude that the target product \"B00IL7BG98\" falls under the category of Cell.Phones.&.Accessories.'], 'difficulty': 'easy', 'from': 'OGBN-Products'},\n",
       "       {'task_name': 'graph-structure-modeling-graph-connectivity-detection-nlgraph', 'idx': 785, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"connectivity-detection\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];\\n    edge_list = [(0 <-> 4), (0 <-> 8), (1 <-> 5), (2 <-> 3), (3 <-> 5), (3 <-> 11), (4 <-> 8), (5 <-> 9), (5 <-> 7), (5 <-> 10), (6 <-> 11)];\\n}\\n```\\nTask definition: determine if there is a path between two nodes in the graph.\\nQ: Is there a path between node 3 and node 4? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"connectivity-detection\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];\\n    edge_list = [(0 <-> 4), (0 <-> 8), (1 <-> 5), (2 <-> 3), (3 <-> 5), (3 <-> 11), (4 <-> 8), (5 <-> 9), (5 <-> 7), (5 <-> 10), (6 <-> 11)];\\n}\\n```', 'graph': {'node_list': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], 'edge_list': [('0', '4'), ('0', '8'), ('1', '5'), ('2', '3'), ('3', '5'), ('3', '11'), ('4', '8'), ('5', '9'), ('5', '7'), ('5', '10'), ('6', '11')]}, 'answer': ['The answer is no.'], 'answer_with_cot': ['Yes, there is a path between node 3 and node 4. \\n\\nHere is the step-by-step path:\\n1. Node 3 is connected to node 2.\\n2. Node 2 is connected to node 3.\\n3. Node 3 is connected to node 5.\\n4. Node 5 is connected to node 4.\\n\\nTherefore, there is a path between node 3 and node 4.'], 'difficulty': 'medium', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-structure-modeling-graph-shortest-path-nlgraph', 'idx': 253, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"shortest-path\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7];\\n    edge_list = [(0 <-> 1)[weight=4], (0 <-> 7)[weight=3], (0 <-> 3)[weight=4], (0 <-> 2)[weight=1], (0 <-> 6)[weight=2], (0 <-> 4)[weight=2], (1 <-> 7)[weight=1], (1 <-> 3)[weight=2], (1 <-> 5)[weight=4], (1 <-> 2)[weight=2], (1 <-> 6)[weight=1], (1 <-> 4)[weight=1], (2 <-> 7)[weight=4], (2 <-> 3)[weight=4], (2 <-> 5)[weight=3], (2 <-> 6)[weight=3], (2 <-> 4)[weight=2], (3 <-> 7)[weight=1], (3 <-> 5)[weight=2], (3 <-> 6)[weight=3], (3 <-> 4)[weight=3], (4 <-> 7)[weight=2], (4 <-> 5)[weight=1], (4 <-> 6)[weight=3], (5 <-> 7)[weight=3], (5 <-> 6)[weight=3], (6 <-> 7)[weight=3]];\\n}\\n```\\nTask definition: find a shortest path between two nodes in the graph, and calculate the sum of the weights in the shortest path.\\nQ: Give the shortest path from node 5 to node 0. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"shortest-path\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7];\\n    edge_list = [(0 <-> 1)[weight=4], (0 <-> 7)[weight=3], (0 <-> 3)[weight=4], (0 <-> 2)[weight=1], (0 <-> 6)[weight=2], (0 <-> 4)[weight=2], (1 <-> 7)[weight=1], (1 <-> 3)[weight=2], (1 <-> 5)[weight=4], (1 <-> 2)[weight=2], (1 <-> 6)[weight=1], (1 <-> 4)[weight=1], (2 <-> 7)[weight=4], (2 <-> 3)[weight=4], (2 <-> 5)[weight=3], (2 <-> 6)[weight=3], (2 <-> 4)[weight=2], (3 <-> 7)[weight=1], (3 <-> 5)[weight=2], (3 <-> 6)[weight=3], (3 <-> 4)[weight=3], (4 <-> 7)[weight=2], (4 <-> 5)[weight=1], (4 <-> 6)[weight=3], (5 <-> 7)[weight=3], (5 <-> 6)[weight=3], (6 <-> 7)[weight=3]];\\n}\\n```', 'graph': {'node_list': [0, 1, 2, 3, 4, 5, 6, 7], 'edge_list': [('0', '4', '1'), ('0', '3', '7'), ('0', '4', '3'), ('0', '1', '2'), ('0', '2', '6'), ('0', '2', '4'), ('1', '1', '7'), ('1', '2', '3'), ('1', '4', '5'), ('1', '2', '2'), ('1', '1', '6'), ('1', '1', '4'), ('2', '4', '7'), ('2', '4', '3'), ('2', '3', '5'), ('2', '3', '6'), ('2', '2', '4'), ('3', '1', '7'), ('3', '2', '5'), ('3', '3', '6'), ('3', '3', '4'), ('4', '2', '7'), ('4', '1', '5'), ('4', '3', '6'), ('5', '3', '7'), ('5', '3', '6'), ('6', '3', '7')]}, 'answer': ['The shortest path from node 5 to node 0 is 5,4,0 with a total weight of 3'], 'answer_with_cot': [\"To find the shortest path from node 5 to node 0, we can use the Dijkstra's algorithm or the Bellman-Ford algorithm. \\nHere are the steps:\\n1. Initialize all nodes with a distance of infinity except the source node (node 5) which has a distance of 0.\\n2. Set the source node (node 5) as the current node.\\n3. For each neighbor of the current node, calculate the distance from the source node to the neighbor using the weights of the edges.\\n4. Update the distance of the neighbor if the newly calculated distance is smaller than its current distance.\\n5. Mark the current node as visited.\\n6. Select the unvisited node with the smallest distance as the new current node and repeat steps 3-6 until all nodes are visited or the target node (node 0) is reached.\\n7. If the target node (node 0) is reached, backtrack from the target node to the source node to find the shortest path and calculate the sum of the weights in the shortest path.\\n\\nUsing this algorithm, we can find the shortest path from node 5 to node 0 and calculate the sum of the weights in the shortest path.\"], 'difficulty': 'easy', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-structure-modeling-graph-shortest-path-nlgraph', 'idx': 246, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"shortest-path\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];\\n    edge_list = [(0 <-> 1)[weight=5], (0 <-> 16)[weight=4], (1 <-> 4)[weight=8], (2 <-> 12)[weight=1], (2 <-> 4)[weight=7], (2 <-> 3)[weight=6], (2 <-> 9)[weight=9], (2 <-> 11)[weight=7], (2 <-> 8)[weight=2], (2 <-> 13)[weight=2], (3 <-> 5)[weight=10], (3 <-> 9)[weight=10], (3 <-> 14)[weight=2], (3 <-> 17)[weight=5], (3 <-> 10)[weight=7], (4 <-> 6)[weight=5], (4 <-> 17)[weight=10], (4 <-> 10)[weight=8], (6 <-> 14)[weight=1], (6 <-> 17)[weight=2], (6 <-> 13)[weight=6], (7 <-> 9)[weight=3], (7 <-> 15)[weight=2], (9 <-> 13)[weight=6], (10 <-> 14)[weight=5], (10 <-> 13)[weight=4], (11 <-> 12)[weight=10], (11 <-> 13)[weight=5], (13 <-> 15)[weight=6], (15 <-> 17)[weight=1]];\\n}\\n```\\nTask definition: find a shortest path between two nodes in the graph, and calculate the sum of the weights in the shortest path.\\nQ: Give the shortest path from node 13 to node 16. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"shortest-path\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];\\n    edge_list = [(0 <-> 1)[weight=5], (0 <-> 16)[weight=4], (1 <-> 4)[weight=8], (2 <-> 12)[weight=1], (2 <-> 4)[weight=7], (2 <-> 3)[weight=6], (2 <-> 9)[weight=9], (2 <-> 11)[weight=7], (2 <-> 8)[weight=2], (2 <-> 13)[weight=2], (3 <-> 5)[weight=10], (3 <-> 9)[weight=10], (3 <-> 14)[weight=2], (3 <-> 17)[weight=5], (3 <-> 10)[weight=7], (4 <-> 6)[weight=5], (4 <-> 17)[weight=10], (4 <-> 10)[weight=8], (6 <-> 14)[weight=1], (6 <-> 17)[weight=2], (6 <-> 13)[weight=6], (7 <-> 9)[weight=3], (7 <-> 15)[weight=2], (9 <-> 13)[weight=6], (10 <-> 14)[weight=5], (10 <-> 13)[weight=4], (11 <-> 12)[weight=10], (11 <-> 13)[weight=5], (13 <-> 15)[weight=6], (15 <-> 17)[weight=1]];\\n}\\n```', 'graph': {'node_list': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], 'edge_list': [('0', '5', '1'), ('0', '4', '16'), ('1', '8', '4'), ('2', '1', '12'), ('2', '7', '4'), ('2', '6', '3'), ('2', '9', '9'), ('2', '7', '11'), ('2', '2', '8'), ('2', '2', '13'), ('3', '10', '5'), ('3', '10', '9'), ('3', '2', '14'), ('3', '5', '17'), ('3', '7', '10'), ('4', '5', '6'), ('4', '10', '17'), ('4', '8', '10'), ('6', '1', '14'), ('6', '2', '17'), ('6', '6', '13'), ('7', '3', '9'), ('7', '2', '15'), ('9', '6', '13'), ('10', '5', '14'), ('10', '4', '13'), ('11', '10', '12'), ('11', '5', '13'), ('13', '6', '15'), ('15', '1', '17')]}, 'answer': ['The shortest path from node 13 to node 16 is 13,2,4,1,0,16 with a total weight of 26'], 'answer_with_cot': [\"To find the shortest path from node 13 to node 16, we can use an algorithm like Dijkstra's algorithm.\\n\\n1. Start by initializing a distance array to store the shortest distances from the source node (node 13) to all other nodes. Set the distance of all nodes except the source node to infinity, and set the distance of the source node to 0.\\n\\n2. Initialize a visited array to keep track of visited nodes. Set all elements of the visited array to false.\\n\\n3. Create a priority queue to store nodes and their distances. Add the source node (node 13) to the priority queue with a distance of 0.\\n\\n4. While the priority queue is not empty, do the following steps:\\n   - Remove the node with the smallest distance from the priority queue.\\n   - If the removed node is the target node (node 16), we have found the shortest path. Stop the algorithm.\\n   - If the removed node has not been visited, mark it as visited and update the distances of its neighboring nodes. To update the distances, iterate through the edges connected to the current node:\\n     - If the neighboring node has not been visited and the distance from the source node to the neighboring node through the current node is shorter than its current distance, update its distance.\\n     - Add the neighboring node to the priority queue.\\n\\n5. Once the algorithm is complete and we have found the shortest path from node 13 to node 16, we can trace back the shortest path by starting from the target node and following the nodes with the shortest distances.\\n\\nIn this case, the shortest path from node 13 to node 16 is:\\n13 -> 15 -> 17 -> 4 -> 6 -> 0 -> 16\\n\\nTo calculate the sum of the weights in the shortest path, we need to sum up the weights of the edges along the path:\\nweight(13->15) + weight(15->17) + weight(17->4) + weight(4->6) + weight(6->0) + weight(0->16) =\\n6 + 1 + 10 + 5 + 4 + 4 = 30\\n\\nTherefore, the sum of the weights in the shortest path from node 13 to node 16 is 30.\"], 'difficulty': 'hard', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-language-modeling-graph-node-cls-ogbn-products', 'idx': 6890, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"product-graph\"] {\\n    product_node_list = [\"B00701QYIE\", \"B003VV51CW\", \"B000U5HQG6\", \"B005ELVCAC\", \"B000NA2TTW\", \"B004K4FUB6\", \"B000BB1520\", \"B00153ZR7C\", \"B00004ZETI\", \"B000A0GP22\", \"B000OCY668\", \"B000ZDQI44\", \"B0012S6396\", \"052188747X\", \"B0014VPFPO\", \"B000BKSITY\", \"0813337445\", \"B004RV70U6\", \"B0014CKCLK\", \"B001IQDARK\", \"B00478IT8Q\", \"B000AABL4Y\", \"B000742G0G\", \"B000BKVQT8\", \"1568984936\", \"B001IB2ZBC\", \"1780051166\", \"B000PE0GXC\", \"B000JU7KCW\", \"B001190SGK\"];\\n    product_node_feature = [\"B003VV51CW\".category=\"Movies.&.TV\", \"B000U5HQG6\".category=\"Movies.&.TV\", \"B005ELVCAC\".category=\"Movies.&.TV\", \"B000NA2TTW\".category=\"Movies.&.TV\", \"B004K4FUB6\".category=\"Movies.&.TV\", \"B000BB1520\".category=\"Movies.&.TV\", \"B00153ZR7C\".category=\"Movies.&.TV\", \"B00004ZETI\".category=\"Movies.&.TV\", \"B000A0GP22\".category=\"Movies.&.TV\", \"B000OCY668\".category=\"Movies.&.TV\", \"B000ZDQI44\".category=\"Movies.&.TV\", \"B0012S6396\".category=\"Movies.&.TV\", \"052188747X\".category=\"Books\", \"B0014VPFPO\".category=\"Movies.&.TV\", \"B000BKSITY\".category=\"Movies.&.TV\", \"0813337445\".category=\"Books\", \"B004RV70U6\".category=\"Movies.&.TV\", \"B0014CKCLK\".category=\"Movies.&.TV\", \"B001IQDARK\".category=\"Movies.&.TV\", \"B00478IT8Q\".category=\"Movies.&.TV\", \"B000AABL4Y\".category=\"Movies.&.TV\", \"B000742G0G\".category=\"Movies.&.TV\", \"B000BKVQT8\".category=\"Movies.&.TV\", \"1568984936\".category=\"Books\", \"B001IB2ZBC\".category=\"Movies.&.TV\", \"1780051166\".category=\"Books\", \"B000PE0GXC\".category=\"Movies.&.TV\", \"B000JU7KCW\".category=\"Movies.&.TV\", \"B001190SGK\".category=\"Movies.&.TV\"];\\n    product_triple_list = [(\"B003VV51CW\" -> \"B000U5HQG6\"), (\"B00701QYIE\" -> \"B005ELVCAC\"), (\"B000NA2TTW\" -> \"B004K4FUB6\"), (\"B005ELVCAC\" -> \"B000BB1520\"), (\"B005ELVCAC\" -> \"B00153ZR7C\"), (\"B005ELVCAC\" -> \"B00004ZETI\"), (\"B000A0GP22\" -> \"B000OCY668\"), (\"B000A0GP22\" -> \"B000ZDQI44\"), (\"B0012S6396\" -> \"052188747X\"), (\"B005ELVCAC\" -> \"B0014VPFPO\"), (\"B000A0GP22\" -> \"B000BKSITY\"), (\"B00701QYIE\" -> \"B000NA2TTW\"), (\"B00701QYIE\" -> \"B000A0GP22\"), (\"B0012S6396\" -> \"0813337445\"), (\"B005ELVCAC\" -> \"B004RV70U6\"), (\"B0012S6396\" -> \"B0014CKCLK\"), (\"B000NA2TTW\" -> \"B001IQDARK\"), (\"B000NA2TTW\" -> \"B00478IT8Q\"), (\"B000NA2TTW\" -> \"B000AABL4Y\"), (\"B000NA2TTW\" -> \"B000742G0G\"), (\"B003VV51CW\" -> \"B000BKVQT8\"), (\"B00701QYIE\" -> \"B0012S6396\"), (\"B0012S6396\" -> \"1568984936\"), (\"B000A0GP22\" -> \"B001IB2ZBC\"), (\"B003VV51CW\" -> \"1780051166\"), (\"B003VV51CW\" -> \"B000PE0GXC\"), (\"B0012S6396\" -> \"B000JU7KCW\"), (\"B00701QYIE\" -> \"B003VV51CW\"), (\"B003VV51CW\" -> \"B001190SGK\")];\\n    target_product_node = \"B00701QYIE\";\\n}\\n```\\nTask definition: given a product and corresponding graph, classify the target product into one of Movies.&.TV, Luxury.Beauty, Office.Products, Collectibles.&.Fine.Art, Buy.a.Kindle, Digital.Music, Industrial.&.Scientific, All.Beauty, All.Electronics, #508510.\\nQ: Please classify the target product. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"product-graph\"] {\\n    product_node_list = [\"B00701QYIE\", \"B003VV51CW\", \"B000U5HQG6\", \"B005ELVCAC\", \"B000NA2TTW\", \"B004K4FUB6\", \"B000BB1520\", \"B00153ZR7C\", \"B00004ZETI\", \"B000A0GP22\", \"B000OCY668\", \"B000ZDQI44\", \"B0012S6396\", \"052188747X\", \"B0014VPFPO\", \"B000BKSITY\", \"0813337445\", \"B004RV70U6\", \"B0014CKCLK\", \"B001IQDARK\", \"B00478IT8Q\", \"B000AABL4Y\", \"B000742G0G\", \"B000BKVQT8\", \"1568984936\", \"B001IB2ZBC\", \"1780051166\", \"B000PE0GXC\", \"B000JU7KCW\", \"B001190SGK\"];\\n    product_node_feature = [\"B003VV51CW\".category=\"Movies.&.TV\", \"B000U5HQG6\".category=\"Movies.&.TV\", \"B005ELVCAC\".category=\"Movies.&.TV\", \"B000NA2TTW\".category=\"Movies.&.TV\", \"B004K4FUB6\".category=\"Movies.&.TV\", \"B000BB1520\".category=\"Movies.&.TV\", \"B00153ZR7C\".category=\"Movies.&.TV\", \"B00004ZETI\".category=\"Movies.&.TV\", \"B000A0GP22\".category=\"Movies.&.TV\", \"B000OCY668\".category=\"Movies.&.TV\", \"B000ZDQI44\".category=\"Movies.&.TV\", \"B0012S6396\".category=\"Movies.&.TV\", \"052188747X\".category=\"Books\", \"B0014VPFPO\".category=\"Movies.&.TV\", \"B000BKSITY\".category=\"Movies.&.TV\", \"0813337445\".category=\"Books\", \"B004RV70U6\".category=\"Movies.&.TV\", \"B0014CKCLK\".category=\"Movies.&.TV\", \"B001IQDARK\".category=\"Movies.&.TV\", \"B00478IT8Q\".category=\"Movies.&.TV\", \"B000AABL4Y\".category=\"Movies.&.TV\", \"B000742G0G\".category=\"Movies.&.TV\", \"B000BKVQT8\".category=\"Movies.&.TV\", \"1568984936\".category=\"Books\", \"B001IB2ZBC\".category=\"Movies.&.TV\", \"1780051166\".category=\"Books\", \"B000PE0GXC\".category=\"Movies.&.TV\", \"B000JU7KCW\".category=\"Movies.&.TV\", \"B001190SGK\".category=\"Movies.&.TV\"];\\n    product_triple_list = [(\"B003VV51CW\" -> \"B000U5HQG6\"), (\"B00701QYIE\" -> \"B005ELVCAC\"), (\"B000NA2TTW\" -> \"B004K4FUB6\"), (\"B005ELVCAC\" -> \"B000BB1520\"), (\"B005ELVCAC\" -> \"B00153ZR7C\"), (\"B005ELVCAC\" -> \"B00004ZETI\"), (\"B000A0GP22\" -> \"B000OCY668\"), (\"B000A0GP22\" -> \"B000ZDQI44\"), (\"B0012S6396\" -> \"052188747X\"), (\"B005ELVCAC\" -> \"B0014VPFPO\"), (\"B000A0GP22\" -> \"B000BKSITY\"), (\"B00701QYIE\" -> \"B000NA2TTW\"), (\"B00701QYIE\" -> \"B000A0GP22\"), (\"B0012S6396\" -> \"0813337445\"), (\"B005ELVCAC\" -> \"B004RV70U6\"), (\"B0012S6396\" -> \"B0014CKCLK\"), (\"B000NA2TTW\" -> \"B001IQDARK\"), (\"B000NA2TTW\" -> \"B00478IT8Q\"), (\"B000NA2TTW\" -> \"B000AABL4Y\"), (\"B000NA2TTW\" -> \"B000742G0G\"), (\"B003VV51CW\" -> \"B000BKVQT8\"), (\"B00701QYIE\" -> \"B0012S6396\"), (\"B0012S6396\" -> \"1568984936\"), (\"B000A0GP22\" -> \"B001IB2ZBC\"), (\"B003VV51CW\" -> \"1780051166\"), (\"B003VV51CW\" -> \"B000PE0GXC\"), (\"B0012S6396\" -> \"B000JU7KCW\"), (\"B00701QYIE\" -> \"B003VV51CW\"), (\"B003VV51CW\" -> \"B001190SGK\")];\\n    target_product_node = \"B00701QYIE\";\\n}\\n```', 'graph': {'node_list': ['B00701QYIE', 'B003VV51CW', 'B000U5HQG6', 'B005ELVCAC', 'B000NA2TTW', 'B004K4FUB6', 'B000BB1520', 'B00153ZR7C', 'B00004ZETI', 'B000A0GP22', 'B000OCY668', 'B000ZDQI44', 'B0012S6396', '052188747X', 'B0014VPFPO', 'B000BKSITY', '0813337445', 'B004RV70U6', 'B0014CKCLK', 'B001IQDARK', 'B00478IT8Q', 'B000AABL4Y', 'B000742G0G', 'B000BKVQT8', '1568984936', 'B001IB2ZBC', '1780051166', 'B000PE0GXC', 'B000JU7KCW', 'B001190SGK'], 'edge_list': [('B003VV51CW', 'B000U5HQG6'), ('B00701QYIE', 'B005ELVCAC'), ('B000NA2TTW', 'B004K4FUB6'), ('B005ELVCAC', 'B000BB1520'), ('B005ELVCAC', 'B00153ZR7C'), ('B005ELVCAC', 'B00004ZETI'), ('B000A0GP22', 'B000OCY668'), ('B000A0GP22', 'B000ZDQI44'), ('B0012S6396', '052188747X'), ('B005ELVCAC', 'B0014VPFPO'), ('B000A0GP22', 'B000BKSITY'), ('B00701QYIE', 'B000NA2TTW'), ('B00701QYIE', 'B000A0GP22'), ('B0012S6396', '0813337445'), ('B005ELVCAC', 'B004RV70U6'), ('B0012S6396', 'B0014CKCLK'), ('B000NA2TTW', 'B001IQDARK'), ('B000NA2TTW', 'B00478IT8Q'), ('B000NA2TTW', 'B000AABL4Y'), ('B000NA2TTW', 'B000742G0G'), ('B003VV51CW', 'B000BKVQT8'), ('B00701QYIE', 'B0012S6396'), ('B0012S6396', '1568984936'), ('B000A0GP22', 'B001IB2ZBC'), ('B003VV51CW', '1780051166'), ('B003VV51CW', 'B000PE0GXC'), ('B0012S6396', 'B000JU7KCW'), ('B00701QYIE', 'B003VV51CW'), ('B003VV51CW', 'B001190SGK')], 'node_feature': {'B003VV51CW': {'label': 'Movies.&.TV'}, 'B000U5HQG6': {'label': 'Movies.&.TV'}, 'B005ELVCAC': {'label': 'Movies.&.TV'}, 'B000NA2TTW': {'label': 'Movies.&.TV'}, 'B004K4FUB6': {'label': 'Movies.&.TV'}, 'B000BB1520': {'label': 'Movies.&.TV'}, 'B00153ZR7C': {'label': 'Movies.&.TV'}, 'B00004ZETI': {'label': 'Movies.&.TV'}, 'B000A0GP22': {'label': 'Movies.&.TV'}, 'B000OCY668': {'label': 'Movies.&.TV'}, 'B000ZDQI44': {'label': 'Movies.&.TV'}, 'B0012S6396': {'label': 'Movies.&.TV'}, '052188747X': {'label': 'Books'}, 'B0014VPFPO': {'label': 'Movies.&.TV'}, 'B000BKSITY': {'label': 'Movies.&.TV'}, '0813337445': {'label': 'Books'}, 'B004RV70U6': {'label': 'Movies.&.TV'}, 'B0014CKCLK': {'label': 'Movies.&.TV'}, 'B001IQDARK': {'label': 'Movies.&.TV'}, 'B00478IT8Q': {'label': 'Movies.&.TV'}, 'B000AABL4Y': {'label': 'Movies.&.TV'}, 'B000742G0G': {'label': 'Movies.&.TV'}, 'B000BKVQT8': {'label': 'Movies.&.TV'}, '1568984936': {'label': 'Books'}, 'B001IB2ZBC': {'label': 'Movies.&.TV'}, '1780051166': {'label': 'Books'}, 'B000PE0GXC': {'label': 'Movies.&.TV'}, 'B000JU7KCW': {'label': 'Movies.&.TV'}, 'B001190SGK': {'label': 'Movies.&.TV'}}}, 'answer': ['Movies.&.TV'], 'answer_with_cot': ['To classify the target product, we need to analyze the graph structure and node information provided.\\n\\n1. Graph Structure:\\n- The graph consists of nodes representing different products.\\n- The connections between nodes represent either directed edges (->) or undirected edges (<->) indicating the relationships between the products.\\n\\n2. Node Information:\\n- Each product node is associated with a category feature.\\n- The category feature provides information about the type of product.\\n\\n3. Target Product:\\n- The target product to classify is \"B00701QYIE\".\\n\\nNow, let\\'s classify the target product step by step:\\n\\n1. Find all the neighboring nodes of the target product node \"B00701QYIE\" based on the directed edges (->) in the graph. This will indicate the products that are directly recommended or related to the target product.\\n\\n2. Check the category feature of the neighboring nodes. If all the neighboring nodes have the same category, we can classify the target product with that category. If the neighboring nodes have different categories, we need to continue with further analysis.\\n\\n3. Analyze the neighbors of the neighboring nodes found in step 1. Repeat step 2 to check if there is a common category among the second-level neighbors.\\n\\n4. Continue this process recursively until we find a common category among the neighbors or we reach a dead end. If we reach a dead end without finding a common category, the target product\\'s category remains undefined or may fall into one of the provided categories like All.Beauty, All.Electronics, or #508510.\\n\\nBased on the provided graph and node information, we need to follow the above steps to classify the target product \"B00701QYIE\".'], 'difficulty': 'easy', 'from': 'OGBN-Products'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-wikidata5m', 'idx': 31985, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'aggregat-4\\', \\'Germanz\\', \\'Ferdinand Graf von Zeppelin\\', \\'Fischbach (Friedrichshafen)\\', \\'Rigid airships\\', \\'Deutsche Zeppelin-Reederei\\', \\'spacecraft manufacturing\\', \\'dirigible balloon\\', \\'deutsches kaiserreich\\', \\'Zeppelin Luftschiffbau\\', \\'zepplin\\', \\'zeppelin lz 121 nordstern\\'];\\n    triple_list = [(\"zeppelin lz 121 nordstern\" -> \"zepplin\")[relation=\"instance of\"], (\"zeppelin lz 121 nordstern\" -> \"Rigid airships\")[relation=\"instance of\"], (\"Zeppelin Luftschiffbau\" -> \"spacecraft manufacturing\")[relation=\"instance of\"], (\"Zeppelin Luftschiffbau\" -> \"Germanz\")[relation=\"country\"], (\"Zeppelin Luftschiffbau\" -> \"deutsches kaiserreich\")[relation=\"country\"], (\"Zeppelin Luftschiffbau\" -> \"dirigible balloon\")[relation=\"product or material produced\"], (\"Zeppelin Luftschiffbau\" -> \"aggregat-4\")[relation=\"product or material produced\"], (\"Zeppelin Luftschiffbau\" -> \"Ferdinand Graf von Zeppelin\")[relation=\"founded by\"], (\"Zeppelin Luftschiffbau\" -> \"Fischbach (Friedrichshafen)\")[relation=\"headquarters location\"], (\"Zeppelin Luftschiffbau\" -> \"Deutsche Zeppelin-Reederei\")[relation=\"subsidiary\"], (\"Zeppelin Luftschiffbau\" -> \"zepplin\")[relation=\"notable work\"]];;\\n    head_entity = \"Zeppelin Luftschiffbau\";\\n    tail_entity = \"zepplin\";\\n}\\n```\\nTask definition: given one head entity and tail entity and corresponding one-hop knowledge sub-graph, classify the relation between head entity and tail entity into one of \"founded by\", \"subsidiary\", \"camera setup\", \"product or material produced\", \"instance of\", \"has quality\", \"country\", \"notable work\", \"surface played on\", \"headquarters location\", \"manufacturer\", \"cardinality of this set\", \"canonization status\", \"field of this occupation\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'aggregat-4\\', \\'Germanz\\', \\'Ferdinand Graf von Zeppelin\\', \\'Fischbach (Friedrichshafen)\\', \\'Rigid airships\\', \\'Deutsche Zeppelin-Reederei\\', \\'spacecraft manufacturing\\', \\'dirigible balloon\\', \\'deutsches kaiserreich\\', \\'Zeppelin Luftschiffbau\\', \\'zepplin\\', \\'zeppelin lz 121 nordstern\\'];\\n    triple_list = [(\"zeppelin lz 121 nordstern\" -> \"zepplin\")[relation=\"instance of\"], (\"zeppelin lz 121 nordstern\" -> \"Rigid airships\")[relation=\"instance of\"], (\"Zeppelin Luftschiffbau\" -> \"spacecraft manufacturing\")[relation=\"instance of\"], (\"Zeppelin Luftschiffbau\" -> \"Germanz\")[relation=\"country\"], (\"Zeppelin Luftschiffbau\" -> \"deutsches kaiserreich\")[relation=\"country\"], (\"Zeppelin Luftschiffbau\" -> \"dirigible balloon\")[relation=\"product or material produced\"], (\"Zeppelin Luftschiffbau\" -> \"aggregat-4\")[relation=\"product or material produced\"], (\"Zeppelin Luftschiffbau\" -> \"Ferdinand Graf von Zeppelin\")[relation=\"founded by\"], (\"Zeppelin Luftschiffbau\" -> \"Fischbach (Friedrichshafen)\")[relation=\"headquarters location\"], (\"Zeppelin Luftschiffbau\" -> \"Deutsche Zeppelin-Reederei\")[relation=\"subsidiary\"], (\"Zeppelin Luftschiffbau\" -> \"zepplin\")[relation=\"notable work\"]];;\\n    head_entity = \"Zeppelin Luftschiffbau\";\\n    tail_entity = \"zepplin\";\\n}\\n```', 'graph': {'node_list': ['aggregat-4', 'Germanz', 'Ferdinand Graf von Zeppelin', 'Fischbach (Friedrichshafen)', 'Rigid airships', 'Deutsche Zeppelin-Reederei', 'spacecraft manufacturing', 'dirigible balloon', 'deutsches kaiserreich', 'Zeppelin Luftschiffbau', 'zepplin', 'zeppelin lz 121 nordstern'], 'edge_list': [('zeppelin lz 121 nordstern', 'instance of', 'zepplin'), ('zeppelin lz 121 nordstern', 'instance of', 'Rigid airships'), ('Zeppelin Luftschiffbau', 'instance of', 'spacecraft manufacturing'), ('Zeppelin Luftschiffbau', 'country', 'Germanz'), ('Zeppelin Luftschiffbau', 'country', 'deutsches kaiserreich'), ('Zeppelin Luftschiffbau', 'product or material produced', 'dirigible balloon'), ('Zeppelin Luftschiffbau', 'product or material produced', 'aggregat-4'), ('Zeppelin Luftschiffbau', 'founded by', 'Ferdinand Graf von Zeppelin'), ('Zeppelin Luftschiffbau', 'headquarters location', 'Fischbach (Friedrichshafen)'), ('Zeppelin Luftschiffbau', 'subsidiary', 'Deutsche Zeppelin-Reederei'), ('Zeppelin Luftschiffbau', 'notable work', 'zepplin')]}, 'answer': ['manufacturer'], 'answer_with_cot': ['We can start by examining the provided graph structure and node information:\\n\\n1. The graph name is \"wikidata-knowledge-graph\".\\n2. The entity list consists of 12 nodes: \\'aggregat-4\\', \\'Germanz\\', \\'Ferdinand Graf von Zeppelin\\', \\'Fischbach (Friedrichshafen)\\', \\'Rigid airships\\', \\'Deutsche Zeppelin-Reederei\\', \\'spacecraft manufacturing\\', \\'dirigible balloon\\', \\'deutsches kaiserreich\\', \\'Zeppelin Luftschiffbau\\', \\'zepplin\\', \\'zeppelin lz 121 nordstern\\'.\\n3. The triple list represents the relationships between the nodes, specified as directed edges. Each relationship is described with a relation attribute.\\n4. The head entity is \"Zeppelin Luftschiffbau\".\\n5. The tail entity is \"zepplin\".\\n\\nNow, let\\'s analyze the relationships between the head entity and the tail entity based on the provided graph:\\n\\n1. (\"zeppelin lz 121 nordstern\" -> \"zepplin\")[relation=\"instance of\"]\\n   - The \"zeppelin lz 121 nordstern\" is an instance of \"zepplin\".\\n\\n2. (\"zeppelin lz 121 nordstern\" -> \"Rigid airships\")[relation=\"instance of\"]\\n   - The \"zeppelin lz 121 nordstern\" is an instance of \"Rigid airships\".\\n\\n3. (\"Zeppelin Luftschiffbau\" -> \"spacecraft manufacturing\")[relation=\"instance of\"]\\n   - \"Zeppelin Luftschiffbau\" is an instance of \"spacecraft manufacturing\".\\n\\n4. (\"Zeppelin Luftschiffbau\" -> \"Germanz\")[relation=\"country\"]\\n   - \"Zeppelin Luftschiffbau\" belongs to the country \"Germanz\".\\n\\n5. (\"Zeppelin Luftschiffbau\" -> \"deutsches kaiserreich\")[relation=\"country\"]\\n   - \"Zeppelin Luftschiffbau\" belongs to the country \"deutsches kaiserreich\".\\n\\n6. (\"Zeppelin Luftschiffbau\" -> \"dirigible balloon\")[relation=\"product or material produced\"]\\n   - \"Zeppelin Luftschiffbau\" produces \"dirigible balloon\".\\n\\n7. (\"Zeppelin Luftschiffbau\" -> \"aggregat-4\")[relation=\"product or material produced\"]\\n   - \"Zeppelin Luftschiffbau\" produces \"aggregat-4\".\\n\\n8. (\"Zeppelin Luftschiffbau\" -> \"Ferdinand Graf von Zeppelin\")[relation=\"founded by\"]\\n   - \"Zeppelin Luftschiffbau\" was founded by \"Ferdinand Graf von Zeppelin\".\\n\\n9. (\"Zeppelin Luftschiffbau\" -> \"Fischbach (Friedrichshafen)\")[relation=\"headquarters location\"]\\n   - The headquarters of \"Zeppelin Luftschiffbau\" is located in \"Fischbach (Friedrichshafen)\".\\n\\n10. (\"Zeppelin Luftschiffbau\" -> \"Deutsche Zeppelin-Reederei\")[relation=\"subsidiary\"]\\n    - \"Zeppelin Luftschiffbau\" is a subsidiary of \"Deutsche Zeppelin-Reederei\".\\n\\n11. (\"Zeppelin Luftschiffbau\" -> \"zepplin\")[relation=\"notable work\"]\\n    - \"Zeppelin Luftschiffbau\" has a notable work related to \"zepplin\".\\n\\nBased on the provided information, the relation between the head entity (\"Zeppelin Luftschiffbau\") and the tail entity (\"zepplin\") can be classified as \"notable work\".'], 'difficulty': 'medium', 'from': 'Wikidata5M'},\n",
       "       {'task_name': 'graph-language-modeling-graph-question-answering-pathquestion', 'idx': 3706, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'hemma\\', \\'frankfurt\\', \\'louis_the_german\\', \\'louis_the_stammerer\\', \\'pippin_the_younger\\', \\'piacenza\\', \\'catholicism\\', \\'ermentrude_of_orleans\\', \\'louis_ii_holy_roman_emperor\\', \\'drogo_of_metz\\', \\'male\\', \\'pepin_i_of_aquitaine\\', \\'richilde_of_provence\\', \\'emperor\\', \\'louis_the_pious\\', \\'charlemagne\\', \\'louis_the_younger\\', \\'carloman_of_bavaria\\', \\'female\\', \\'hildegard_of_savoy\\', \\'louis_iii_of_france\\', \\'judith_daughter_of_welf\\', \\'lothair_i\\', \\'lothair_ii_of_lotharingia\\', \\'charles_the_bald\\'];\\n    triple_list = [(\"louis_the_younger\" -> \"louis_the_german\")[relation=\"parents\"], (\"carloman_of_bavaria\" -> \"louis_the_german\")[relation=\"parents\"], (\"louis_the_stammerer\" -> \"ermentrude_of_orleans\")[relation=\"parents\"], (\"charlemagne\" -> \"emperor\")[relation=\"profession\"], (\"charles_the_bald\" -> \"richilde_of_provence\")[relation=\"spouse\"], (\"louis_the_pious\" -> \"pepin_i_of_aquitaine\")[relation=\"children\"], (\"charles_the_bald\" -> \"male\")[relation=\"gender\"], (\"judith_daughter_of_welf\" -> \"louis_the_pious\")[relation=\"spouse\"], (\"hemma\" -> \"female\")[relation=\"gender\"], (\"charlemagne\" -> \"hildegard_of_savoy\")[relation=\"spouse\"], (\"louis_the_younger\" -> \"hemma\")[relation=\"parents\"], (\"hildegard_of_savoy\" -> \"female\")[relation=\"gender\"], (\"lothair_ii_of_lotharingia\" -> \"piacenza\")[relation=\"place_of_death\"], (\"charlemagne\" -> \"catholicism\")[relation=\"religion\"], (\"charlemagne\" -> \"drogo_of_metz\")[relation=\"children\"], (\"hemma\" -> \"carloman_of_bavaria\")[relation=\"children\"], (\"hemma\" -> \"louis_the_younger\")[relation=\"children\"], (\"louis_the_stammerer\" -> \"male\")[relation=\"gender\"], (\"pippin_the_younger\" -> \"male\")[relation=\"gender\"], (\"judith_daughter_of_welf\" -> \"female\")[relation=\"gender\"], (\"louis_ii_holy_roman_emperor\" -> \"lothair_i\")[relation=\"parents\"], (\"louis_the_pious\" -> \"judith_daughter_of_welf\")[relation=\"spouse\"], (\"louis_the_pious\" -> \"charlemagne\")[relation=\"parents\"], (\"carloman_of_bavaria\" -> \"male\")[relation=\"gender\"], (\"lothair_ii_of_lotharingia\" -> \"male\")[relation=\"gender\"], (\"charles_the_bald\" -> \"frankfurt\")[relation=\"place_of_birth\"], (\"louis_the_stammerer\" -> \"louis_iii_of_france\")[relation=\"children\"]];\\n}\\n```\\nTask definition: given a question and factual knowledge graph, find an entity and a reasoning path in the graph to answer the question.\\nQ: what does louis_the_pious \\'s dad do for a living? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'hemma\\', \\'frankfurt\\', \\'louis_the_german\\', \\'louis_the_stammerer\\', \\'pippin_the_younger\\', \\'piacenza\\', \\'catholicism\\', \\'ermentrude_of_orleans\\', \\'louis_ii_holy_roman_emperor\\', \\'drogo_of_metz\\', \\'male\\', \\'pepin_i_of_aquitaine\\', \\'richilde_of_provence\\', \\'emperor\\', \\'louis_the_pious\\', \\'charlemagne\\', \\'louis_the_younger\\', \\'carloman_of_bavaria\\', \\'female\\', \\'hildegard_of_savoy\\', \\'louis_iii_of_france\\', \\'judith_daughter_of_welf\\', \\'lothair_i\\', \\'lothair_ii_of_lotharingia\\', \\'charles_the_bald\\'];\\n    triple_list = [(\"louis_the_younger\" -> \"louis_the_german\")[relation=\"parents\"], (\"carloman_of_bavaria\" -> \"louis_the_german\")[relation=\"parents\"], (\"louis_the_stammerer\" -> \"ermentrude_of_orleans\")[relation=\"parents\"], (\"charlemagne\" -> \"emperor\")[relation=\"profession\"], (\"charles_the_bald\" -> \"richilde_of_provence\")[relation=\"spouse\"], (\"louis_the_pious\" -> \"pepin_i_of_aquitaine\")[relation=\"children\"], (\"charles_the_bald\" -> \"male\")[relation=\"gender\"], (\"judith_daughter_of_welf\" -> \"louis_the_pious\")[relation=\"spouse\"], (\"hemma\" -> \"female\")[relation=\"gender\"], (\"charlemagne\" -> \"hildegard_of_savoy\")[relation=\"spouse\"], (\"louis_the_younger\" -> \"hemma\")[relation=\"parents\"], (\"hildegard_of_savoy\" -> \"female\")[relation=\"gender\"], (\"lothair_ii_of_lotharingia\" -> \"piacenza\")[relation=\"place_of_death\"], (\"charlemagne\" -> \"catholicism\")[relation=\"religion\"], (\"charlemagne\" -> \"drogo_of_metz\")[relation=\"children\"], (\"hemma\" -> \"carloman_of_bavaria\")[relation=\"children\"], (\"hemma\" -> \"louis_the_younger\")[relation=\"children\"], (\"louis_the_stammerer\" -> \"male\")[relation=\"gender\"], (\"pippin_the_younger\" -> \"male\")[relation=\"gender\"], (\"judith_daughter_of_welf\" -> \"female\")[relation=\"gender\"], (\"louis_ii_holy_roman_emperor\" -> \"lothair_i\")[relation=\"parents\"], (\"louis_the_pious\" -> \"judith_daughter_of_welf\")[relation=\"spouse\"], (\"louis_the_pious\" -> \"charlemagne\")[relation=\"parents\"], (\"carloman_of_bavaria\" -> \"male\")[relation=\"gender\"], (\"lothair_ii_of_lotharingia\" -> \"male\")[relation=\"gender\"], (\"charles_the_bald\" -> \"frankfurt\")[relation=\"place_of_birth\"], (\"louis_the_stammerer\" -> \"louis_iii_of_france\")[relation=\"children\"]];\\n}\\n```', 'graph': {'node_list': ['hemma', 'frankfurt', 'louis_the_german', 'louis_the_stammerer', 'pippin_the_younger', 'piacenza', 'catholicism', 'ermentrude_of_orleans', 'louis_ii_holy_roman_emperor', 'drogo_of_metz', 'male', 'pepin_i_of_aquitaine', 'richilde_of_provence', 'emperor', 'louis_the_pious', 'charlemagne', 'louis_the_younger', 'carloman_of_bavaria', 'female', 'hildegard_of_savoy', 'louis_iii_of_france', 'judith_daughter_of_welf', 'lothair_i', 'lothair_ii_of_lotharingia', 'charles_the_bald'], 'edge_list': [('louis_the_younger', 'parents', 'louis_the_german'), ('carloman_of_bavaria', 'parents', 'louis_the_german'), ('louis_the_stammerer', 'parents', 'ermentrude_of_orleans'), ('charlemagne', 'profession', 'emperor'), ('charles_the_bald', 'spouse', 'richilde_of_provence'), ('louis_the_pious', 'children', 'pepin_i_of_aquitaine'), ('charles_the_bald', 'gender', 'male'), ('judith_daughter_of_welf', 'spouse', 'louis_the_pious'), ('hemma', 'gender', 'female'), ('charlemagne', 'spouse', 'hildegard_of_savoy'), ('louis_the_younger', 'parents', 'hemma'), ('hildegard_of_savoy', 'gender', 'female'), ('lothair_ii_of_lotharingia', 'place_of_death', 'piacenza'), ('charlemagne', 'religion', 'catholicism'), ('charlemagne', 'children', 'drogo_of_metz'), ('hemma', 'children', 'carloman_of_bavaria'), ('hemma', 'children', 'louis_the_younger'), ('louis_the_stammerer', 'gender', 'male'), ('pippin_the_younger', 'gender', 'male'), ('judith_daughter_of_welf', 'gender', 'female'), ('louis_ii_holy_roman_emperor', 'parents', 'lothair_i'), ('louis_the_pious', 'spouse', 'judith_daughter_of_welf'), ('louis_the_pious', 'parents', 'charlemagne'), ('carloman_of_bavaria', 'gender', 'male'), ('lothair_ii_of_lotharingia', 'gender', 'male'), ('charles_the_bald', 'place_of_birth', 'frankfurt'), ('louis_the_stammerer', 'children', 'louis_iii_of_france')]}, 'answer': ['emperor'], 'answer_with_cot': ['To answer the question, we need to find the entity \"louis_the_pious\" in the graph and then find the relationship that describes his profession. \\n\\n1. Find \"louis_the_pious\" in the \"entity_list\" - we can see that \"louis_the_pious\" is present in the graph.\\n\\n2. Find the relationship that describes his profession - we can see that there is a triple (\"charlemagne\" -> \"emperor\")[relation=\"profession\"] in the \"triple_list\". This means that \"charlemagne\" is the entity who has the profession \"emperor\".\\n\\n3. Determine the reasoning path - the reasoning path to answer the question would be: \"louis_the_pious\" -> (\"louis_the_pious\" -> \"charlemagne\")[relation=\"parents\"] -> (\"charlemagne\" -> \"emperor\")[relation=\"profession\"].\\n\\nTherefore, the answer to the question \"what does louis_the_pious\\'s dad do for a living?\" is that \"louis_the_pious\\'s dad, charlemagne, is an emperor\".', \"[('louis_the_pious', 'parents', 'charlemagne'), ('charlemagne', 'profession', 'emperor')]\"], 'difficulty': 'simple', 'from': 'PathQuestion'},\n",
       "       {'task_name': 'graph-language-modeling-graph-node-cls-citeseer', 'idx': 327, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"citeseer-scientific-publications-citation-graph\"] {\\n    publication_node_list = [\"paper_1793\", \"paper_1777\"];\\n    publication_node_feature = [\"paper_1777\".category=\"HCI\"];\\n    target_publication_node = \"paper_1793\";\\n    citation_triple_list = [(\"paper_1793\" -> \"paper_1777\")];\\n}\\n```\\nTask definition: given a target scientific publication and corresponding citation graph, classify the target scientific publication into one of six categories, such as \\'AI\\', \\'Agents\\', \\'DB\\', \\'HCI\\', \\'IR\\', and \\'ML\\'.\\nQ: Please classify the target scientific publication. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"citeseer-scientific-publications-citation-graph\"] {\\n    publication_node_list = [\"paper_1793\", \"paper_1777\"];\\n    publication_node_feature = [\"paper_1777\".category=\"HCI\"];\\n    target_publication_node = \"paper_1793\";\\n    citation_triple_list = [(\"paper_1793\" -> \"paper_1777\")];\\n}\\n```', 'graph': {'node_list': {1793, 1777}, 'edge_list': {(1793, 1777)}, 'node_feature': {1777: 'HCI'}}, 'answer': ['HCI'], 'answer_with_cot': ['To classify the target scientific publication, we can follow these steps:\\n\\n1. Extract the target scientific publication and its corresponding citation graph from the given graph language:\\n   - The target scientific publication is \"paper_1793\".\\n   - The citation graph consists of two nodes: \"paper_1793\" and \"paper_1777\".\\n   - There is a directed edge from \"paper_1793\" to \"paper_1777\".\\n\\n2. Check the node information for the target scientific publication:\\n   - The node \"paper_1777\" has a feature \"category\" with the value \"HCI\".\\n\\n3. Based on the node feature, classify the target scientific publication as \"HCI\".\\n\\nTherefore, the target scientific publication is classified as \"HCI\".'], 'difficulty': 'easy', 'from': 'CiteSeer'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-conceptnet', 'idx': 27968, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"conceptnet-knowledge-graph\"] {\\n    entity_list = [\\'get fish permit\\', \\'fish\\', \\'china\\', \\'getting lolly pops\\', \\'getting a haircut\\', \\'drink\\', \\'shop\\', \\'water\\', \\'plane\\', \\'teapot\\', \\'evolve into efficient swimmer\\', \\'contain resident\\', \\'city\\', \\'backpack\\', \\'growing plants\\', \\'scissors get blunted\\', \\'lonely\\', \\'large than hamlet\\', \\'hangover\\', \\'your table\\', \\'town\\', \\'fun\\', \\'blue\\', \\'combining oxygen, hydrogen and electricity\\', \\'any state\\', \\'michigan\\', \\'a barbershop\\', \\'cycle\\', \\'many shade\\', \\'oxygen\\', \\'spout\\', \\'cold\\', \\'eat fish\\', \\'big or small\\', \\'likely to have several cafe\\', \\'prarie dog community\\', \\'space\\', \\'country\\', \\'rural area\\'];\\n    triple_list = [(\"town\" -> \"country\")[relation=\"AtLocation\"], (\"town\" -> \"shop\")[relation=\"HasA\"], (\"town\" -> \"city\")[relation=\"IsA\"], (\"a barbershop\" -> \"getting lolly pops\")[relation=\"UsedFor\"], (\"a barbershop\" -> \"getting a haircut\")[relation=\"UsedFor\"], (\"a barbershop\" -> \"town\")[relation=\"AtLocation\"], (\"getting a haircut\" -> \"scissors get blunted\")[relation=\"Causes\"], (\"town\" -> \"any state\")[relation=\"AtLocation\"], (\"town\" -> \"rural area\")[relation=\"AtLocation\"], (\"town\" -> \"michigan\")[relation=\"AtLocation\"], (\"town\" -> \"contain resident\")[relation=\"UsedFor\"], (\"town\" -> \"prarie dog community\")[relation=\"DefinedAs\"], (\"town\" -> \"large than hamlet\")[relation=\"IsA\"], (\"town\" -> \"big or small\")[relation=\"HasProperty\"], (\"town\" -> \"likely to have several cafe\")[relation=\"HasProperty\"], (\"fish\" -> \"get fish permit\")[relation=\"HasPrerequisite\"], (\"fish\" -> \"evolve into efficient swimmer\")[relation=\"HasA\"], (\"water\" -> \"growing plants\")[relation=\"UsedFor\"], (\"fish\" -> \"eat fish\")[relation=\"MotivatedByGoal\"], (\"fish\" -> \"china\")[relation=\"AtLocation\"], (\"fish\" -> \"lonely\")[relation=\"HasProperty\"], (\"drink\" -> \"hangover\")[relation=\"Causes\"], (\"oxygen\" -> \"plane\")[relation=\"AtLocation\"], (\"cold\" -> \"space\")[relation=\"AtLocation\"], (\"blue\" -> \"many shade\")[relation=\"HasA\"], (\"drink\" -> \"your table\")[relation=\"AtLocation\"], (\"drink\" -> \"backpack\")[relation=\"AtLocation\"], (\"water\" -> \"combining oxygen, hydrogen and electricity\")[relation=\"CreatedBy\"], (\"spout\" -> \"teapot\")[relation=\"AtLocation\"], (\"cycle\" -> \"fun\")[relation=\"HasProperty\"]];;\\n    head_entity = \"cycle\";\\n    tail_entity = \"fun\";\\n}\\n```\\nTask definition: given a head entity and a tail entity, and each entity may has a text description and a knowledge sub-graph, classify the relation between head entity and tail entity into one of \"CreatedBy\", \"UsedFor\", \"Desires\", \"IsA\", \"PartOf\", \"ReceivesAction\", \"InheritsFrom\", \"DesireOf\", \"CapableOf\", \"HasA\", \"AtLocation\", \"HasProperty\", \"LocatedNear\", \"MadeOf\", \"DefinedAs\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"conceptnet-knowledge-graph\"] {\\n    entity_list = [\\'get fish permit\\', \\'fish\\', \\'china\\', \\'getting lolly pops\\', \\'getting a haircut\\', \\'drink\\', \\'shop\\', \\'water\\', \\'plane\\', \\'teapot\\', \\'evolve into efficient swimmer\\', \\'contain resident\\', \\'city\\', \\'backpack\\', \\'growing plants\\', \\'scissors get blunted\\', \\'lonely\\', \\'large than hamlet\\', \\'hangover\\', \\'your table\\', \\'town\\', \\'fun\\', \\'blue\\', \\'combining oxygen, hydrogen and electricity\\', \\'any state\\', \\'michigan\\', \\'a barbershop\\', \\'cycle\\', \\'many shade\\', \\'oxygen\\', \\'spout\\', \\'cold\\', \\'eat fish\\', \\'big or small\\', \\'likely to have several cafe\\', \\'prarie dog community\\', \\'space\\', \\'country\\', \\'rural area\\'];\\n    triple_list = [(\"town\" -> \"country\")[relation=\"AtLocation\"], (\"town\" -> \"shop\")[relation=\"HasA\"], (\"town\" -> \"city\")[relation=\"IsA\"], (\"a barbershop\" -> \"getting lolly pops\")[relation=\"UsedFor\"], (\"a barbershop\" -> \"getting a haircut\")[relation=\"UsedFor\"], (\"a barbershop\" -> \"town\")[relation=\"AtLocation\"], (\"getting a haircut\" -> \"scissors get blunted\")[relation=\"Causes\"], (\"town\" -> \"any state\")[relation=\"AtLocation\"], (\"town\" -> \"rural area\")[relation=\"AtLocation\"], (\"town\" -> \"michigan\")[relation=\"AtLocation\"], (\"town\" -> \"contain resident\")[relation=\"UsedFor\"], (\"town\" -> \"prarie dog community\")[relation=\"DefinedAs\"], (\"town\" -> \"large than hamlet\")[relation=\"IsA\"], (\"town\" -> \"big or small\")[relation=\"HasProperty\"], (\"town\" -> \"likely to have several cafe\")[relation=\"HasProperty\"], (\"fish\" -> \"get fish permit\")[relation=\"HasPrerequisite\"], (\"fish\" -> \"evolve into efficient swimmer\")[relation=\"HasA\"], (\"water\" -> \"growing plants\")[relation=\"UsedFor\"], (\"fish\" -> \"eat fish\")[relation=\"MotivatedByGoal\"], (\"fish\" -> \"china\")[relation=\"AtLocation\"], (\"fish\" -> \"lonely\")[relation=\"HasProperty\"], (\"drink\" -> \"hangover\")[relation=\"Causes\"], (\"oxygen\" -> \"plane\")[relation=\"AtLocation\"], (\"cold\" -> \"space\")[relation=\"AtLocation\"], (\"blue\" -> \"many shade\")[relation=\"HasA\"], (\"drink\" -> \"your table\")[relation=\"AtLocation\"], (\"drink\" -> \"backpack\")[relation=\"AtLocation\"], (\"water\" -> \"combining oxygen, hydrogen and electricity\")[relation=\"CreatedBy\"], (\"spout\" -> \"teapot\")[relation=\"AtLocation\"], (\"cycle\" -> \"fun\")[relation=\"HasProperty\"]];;\\n    head_entity = \"cycle\";\\n    tail_entity = \"fun\";\\n}\\n```', 'graph': {'node_list': ['get fish permit', 'fish', 'china', 'getting lolly pops', 'getting a haircut', 'drink', 'shop', 'water', 'plane', 'teapot', 'evolve into efficient swimmer', 'contain resident', 'city', 'backpack', 'growing plants', 'scissors get blunted', 'lonely', 'large than hamlet', 'hangover', 'your table', 'town', 'fun', 'blue', 'combining oxygen, hydrogen and electricity', 'any state', 'michigan', 'a barbershop', 'cycle', 'many shade', 'oxygen', 'spout', 'cold', 'eat fish', 'big or small', 'likely to have several cafe', 'prarie dog community', 'space', 'country', 'rural area'], 'edge_list': [('town', 'AtLocation', 'country'), ('town', 'HasA', 'shop'), ('town', 'IsA', 'city'), ('a barbershop', 'UsedFor', 'getting lolly pops'), ('a barbershop', 'UsedFor', 'getting a haircut'), ('a barbershop', 'AtLocation', 'town'), ('getting a haircut', 'Causes', 'scissors get blunted'), ('town', 'AtLocation', 'any state'), ('town', 'AtLocation', 'rural area'), ('town', 'AtLocation', 'michigan'), ('town', 'UsedFor', 'contain resident'), ('town', 'DefinedAs', 'prarie dog community'), ('town', 'IsA', 'large than hamlet'), ('town', 'HasProperty', 'big or small'), ('town', 'HasProperty', 'likely to have several cafe'), ('fish', 'HasPrerequisite', 'get fish permit'), ('fish', 'HasA', 'evolve into efficient swimmer'), ('water', 'UsedFor', 'growing plants'), ('fish', 'MotivatedByGoal', 'eat fish'), ('fish', 'AtLocation', 'china'), ('fish', 'HasProperty', 'lonely'), ('drink', 'Causes', 'hangover'), ('oxygen', 'AtLocation', 'plane'), ('cold', 'AtLocation', 'space'), ('blue', 'HasA', 'many shade'), ('drink', 'AtLocation', 'your table'), ('drink', 'AtLocation', 'backpack'), ('water', 'CreatedBy', 'combining oxygen, hydrogen and electricity'), ('spout', 'AtLocation', 'teapot'), ('cycle', 'HasProperty', 'fun')]}, 'answer': ['AtLocation'], 'answer_with_cot': ['To classify the relation between the head entity \"cycle\" and the tail entity \"fun\", we can follow these steps:\\n\\n1. Identify the path between the head entity and the tail entity in the given knowledge sub-graph. The path represents the series of relationships connecting the two entities.\\n   - In this case, the path between \"cycle\" and \"fun\" is: \"cycle\" -> \"fun\".\\n\\n2. Analyze the relationship labels along the identified path to determine the overall relation between the head entity and the tail entity.\\n   - The relationship label between \"cycle\" and \"fun\" is \"HasProperty\".\\n\\n3. Classify the relation based on the determined overall relation.\\n   - In this case, the relation between \"cycle\" and \"fun\" can be classified as \"HasProperty\".\\n\\nTherefore, the relation between the head entity \"cycle\" and the tail entity \"fun\" is \"HasProperty\".'], 'difficulty': 'medium', 'from': 'ConceptNet'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-conceptnet', 'idx': 17790, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"conceptnet-knowledge-graph\"] {\\n    entity_list = [\\'New York City\\', \\'virginia\\', \\'tool\\', \\'south of maryland\\', \\'continent\\', \\'roof\\', \\'is a mammal\\', \\'a resturant\\', \\'dancing\\', \\'a fox\\', \\'a\\', \\'Las Vegas\\', \\'nothing\\', \\'can begin to leak\\', \\'letter\\', \\'another continent\\', \\'born in north carolina\\', \\'a bar\\', \\'asia\\', \\'container\\'];\\n    triple_list = [(\"a\" -> \"can begin to leak\")[relation=\"CapableOf\"], (\"a\" -> \"is a mammal\")[relation=\"CapableOf\"], (\"a bar\" -> \"New York City\")[relation=\"AtLocation\"], (\"a\" -> \"a resturant\")[relation=\"AtLocation\"], (\"a fox\" -> \"a bar\")[relation=\"AtLocation\"], (\"a\" -> \"container\")[relation=\"IsA\"], (\"a\" -> \"letter\")[relation=\"IsA\"], (\"a bar\" -> \"dancing\")[relation=\"UsedFor\"], (\"a\" -> \"roof\")[relation=\"AtLocation\"], (\"a bar\" -> \"Las Vegas\")[relation=\"AtLocation\"], (\"asia\" -> \"another continent\")[relation=\"IsA\"], (\"asia\" -> \"continent\")[relation=\"IsA\"], (\"a\" -> \"tool\")[relation=\"IsA\"], (\"a fox\" -> \"a\")[relation=\"AtLocation\"], (\"a\" -> \"nothing\")[relation=\"HasA\"], (\"virginia\" -> \"south of maryland\")[relation=\"HasProperty\"], (\"virginia\" -> \"born in north carolina\")[relation=\"ReceivesAction\"]];;\\n    head_entity = \"virginia\";\\n    tail_entity = \"born in north carolina\";\\n}\\n```\\nTask definition: given a head entity and a tail entity, and each entity may has a text description and a knowledge sub-graph, classify the relation between head entity and tail entity into one of \"UsedFor\", \"HasFirstSubevent\", \"ReceivesAction\", \"HasPainIntensity\", \"CapableOf\", \"AtLocation\", \"HasProperty\", \"DefinedAs\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"conceptnet-knowledge-graph\"] {\\n    entity_list = [\\'New York City\\', \\'virginia\\', \\'tool\\', \\'south of maryland\\', \\'continent\\', \\'roof\\', \\'is a mammal\\', \\'a resturant\\', \\'dancing\\', \\'a fox\\', \\'a\\', \\'Las Vegas\\', \\'nothing\\', \\'can begin to leak\\', \\'letter\\', \\'another continent\\', \\'born in north carolina\\', \\'a bar\\', \\'asia\\', \\'container\\'];\\n    triple_list = [(\"a\" -> \"can begin to leak\")[relation=\"CapableOf\"], (\"a\" -> \"is a mammal\")[relation=\"CapableOf\"], (\"a bar\" -> \"New York City\")[relation=\"AtLocation\"], (\"a\" -> \"a resturant\")[relation=\"AtLocation\"], (\"a fox\" -> \"a bar\")[relation=\"AtLocation\"], (\"a\" -> \"container\")[relation=\"IsA\"], (\"a\" -> \"letter\")[relation=\"IsA\"], (\"a bar\" -> \"dancing\")[relation=\"UsedFor\"], (\"a\" -> \"roof\")[relation=\"AtLocation\"], (\"a bar\" -> \"Las Vegas\")[relation=\"AtLocation\"], (\"asia\" -> \"another continent\")[relation=\"IsA\"], (\"asia\" -> \"continent\")[relation=\"IsA\"], (\"a\" -> \"tool\")[relation=\"IsA\"], (\"a fox\" -> \"a\")[relation=\"AtLocation\"], (\"a\" -> \"nothing\")[relation=\"HasA\"], (\"virginia\" -> \"south of maryland\")[relation=\"HasProperty\"], (\"virginia\" -> \"born in north carolina\")[relation=\"ReceivesAction\"]];;\\n    head_entity = \"virginia\";\\n    tail_entity = \"born in north carolina\";\\n}\\n```', 'graph': {'node_list': ['New York City', 'virginia', 'tool', 'south of maryland', 'continent', 'roof', 'is a mammal', 'a resturant', 'dancing', 'a fox', 'a', 'Las Vegas', 'nothing', 'can begin to leak', 'letter', 'another continent', 'born in north carolina', 'a bar', 'asia', 'container'], 'edge_list': [('a', 'CapableOf', 'can begin to leak'), ('a', 'CapableOf', 'is a mammal'), ('a bar', 'AtLocation', 'New York City'), ('a', 'AtLocation', 'a resturant'), ('a fox', 'AtLocation', 'a bar'), ('a', 'IsA', 'container'), ('a', 'IsA', 'letter'), ('a bar', 'UsedFor', 'dancing'), ('a', 'AtLocation', 'roof'), ('a bar', 'AtLocation', 'Las Vegas'), ('asia', 'IsA', 'another continent'), ('asia', 'IsA', 'continent'), ('a', 'IsA', 'tool'), ('a fox', 'AtLocation', 'a'), ('a', 'HasA', 'nothing'), ('virginia', 'HasProperty', 'south of maryland'), ('virginia', 'ReceivesAction', 'born in north carolina')]}, 'answer': ['AtLocation'], 'answer_with_cot': ['To classify the relation between the head entity and the tail entity, we need to analyze the given knowledge sub-graph and its textual description. \\n\\nStep 1: Understanding the Graph Structure\\nLooking at the graph, we can see that it consists of a list of entities and a list of triples. The entities represent nodes in the graph, while the triples represent the relationships between nodes. Each triple has a source entity, a target entity, and a relation. The graph is labeled as \"conceptnet-knowledge-graph\".\\n\\nStep 2: Identifying the Head and Tail Entities\\nThe head entity is given as \"virginia\", and the tail entity is given as \"born in north carolina\".\\n\\nStep 3: Analyzing the Triples\\nBased on the triples in the graph, we can identify the relevant relationships between the head and tail entities:\\n\\n- (\"virginia\" -> \"south of maryland\")[relation=\"HasProperty\"]\\n- (\"virginia\" -> \"born in north carolina\")[relation=\"ReceivesAction\"]\\n\\nStep 4: Classifying the Relation\\nBased on the identified relationships, we can classify the relation between the head entity (\"virginia\") and the tail entity (\"born in north carolina\") as \"ReceivesAction\".\\n\\nTherefore, the classified relation between the head entity and the tail entity is \"ReceivesAction\".'], 'difficulty': 'medium', 'from': 'ConceptNet'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-conceptnet', 'idx': 21423, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"conceptnet-knowledge-graph\"] {\\n    entity_list = [\\'build by russian engineer\\', \\'the universe is that it\\', \\'there\\', \\'full\\', \\'be debate in u.s\\', \\'big\\', \\'silent\\', \\'more water than land on earth\\', \\'vast\\', \\'limitless\\', \\'mir\\', \\'separate word\\', \\'deviod\\', \\'technical triumph\\', \\'washington state\\', \\'empty room\\', \\'seperation\\', \\'eight musical note\\', \\'space\\', \\'vaccuum\\'];\\n    triple_list = [(\"mir\" -> \"technical triumph\")[relation=\"IsA\"], (\"mir\" -> \"build by russian engineer\")[relation=\"ReceivesAction\"], (\"space\" -> \"deviod\")[relation=\"IsA\"], (\"space\" -> \"there\")[relation=\"IsA\"], (\"there\" -> \"washington state\")[relation=\"PartOf\"], (\"empty room\" -> \"full\")[relation=\"HasProperty\"], (\"space\" -> \"big\")[relation=\"HasProperty\"], (\"there\" -> \"eight musical note\")[relation=\"IsA\"], (\"limitless\" -> \"the universe is that it\")[relation=\"AtLocation\"], (\"space\" -> \"vaccuum\")[relation=\"IsA\"], (\"space\" -> \"silent\")[relation=\"HasProperty\"], (\"space\" -> \"vast\")[relation=\"HasProperty\"], (\"there\" -> \"more water than land on earth\")[relation=\"HasProperty\"], (\"there\" -> \"be debate in u.s\")[relation=\"HasA\"], (\"space\" -> \"seperation\")[relation=\"UsedFor\"], (\"space\" -> \"limitless\")[relation=\"HasProperty\"], (\"space\" -> \"separate word\")[relation=\"CapableOf\"]];;\\n    head_entity = \"space\";\\n    tail_entity = \"separate word\";\\n}\\n```\\nTask definition: given a head entity and a tail entity, and each entity may has a text description and a knowledge sub-graph, classify the relation between head entity and tail entity into one of \"UsedFor\", \"CausesDesire\", \"HasPrerequisite\", \"MotivatedByGoal\", \"IsA\", \"ReceivesAction\", \"CapableOf\", \"HasA\", \"AtLocation\", \"HasProperty\", \"DefinedAs\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"conceptnet-knowledge-graph\"] {\\n    entity_list = [\\'build by russian engineer\\', \\'the universe is that it\\', \\'there\\', \\'full\\', \\'be debate in u.s\\', \\'big\\', \\'silent\\', \\'more water than land on earth\\', \\'vast\\', \\'limitless\\', \\'mir\\', \\'separate word\\', \\'deviod\\', \\'technical triumph\\', \\'washington state\\', \\'empty room\\', \\'seperation\\', \\'eight musical note\\', \\'space\\', \\'vaccuum\\'];\\n    triple_list = [(\"mir\" -> \"technical triumph\")[relation=\"IsA\"], (\"mir\" -> \"build by russian engineer\")[relation=\"ReceivesAction\"], (\"space\" -> \"deviod\")[relation=\"IsA\"], (\"space\" -> \"there\")[relation=\"IsA\"], (\"there\" -> \"washington state\")[relation=\"PartOf\"], (\"empty room\" -> \"full\")[relation=\"HasProperty\"], (\"space\" -> \"big\")[relation=\"HasProperty\"], (\"there\" -> \"eight musical note\")[relation=\"IsA\"], (\"limitless\" -> \"the universe is that it\")[relation=\"AtLocation\"], (\"space\" -> \"vaccuum\")[relation=\"IsA\"], (\"space\" -> \"silent\")[relation=\"HasProperty\"], (\"space\" -> \"vast\")[relation=\"HasProperty\"], (\"there\" -> \"more water than land on earth\")[relation=\"HasProperty\"], (\"there\" -> \"be debate in u.s\")[relation=\"HasA\"], (\"space\" -> \"seperation\")[relation=\"UsedFor\"], (\"space\" -> \"limitless\")[relation=\"HasProperty\"], (\"space\" -> \"separate word\")[relation=\"CapableOf\"]];;\\n    head_entity = \"space\";\\n    tail_entity = \"separate word\";\\n}\\n```', 'graph': {'node_list': ['build by russian engineer', 'the universe is that it', 'there', 'full', 'be debate in u.s', 'big', 'silent', 'more water than land on earth', 'vast', 'limitless', 'mir', 'separate word', 'deviod', 'technical triumph', 'washington state', 'empty room', 'seperation', 'eight musical note', 'space', 'vaccuum'], 'edge_list': [('mir', 'IsA', 'technical triumph'), ('mir', 'ReceivesAction', 'build by russian engineer'), ('space', 'IsA', 'deviod'), ('space', 'IsA', 'there'), ('there', 'PartOf', 'washington state'), ('empty room', 'HasProperty', 'full'), ('space', 'HasProperty', 'big'), ('there', 'IsA', 'eight musical note'), ('limitless', 'AtLocation', 'the universe is that it'), ('space', 'IsA', 'vaccuum'), ('space', 'HasProperty', 'silent'), ('space', 'HasProperty', 'vast'), ('there', 'HasProperty', 'more water than land on earth'), ('there', 'HasA', 'be debate in u.s'), ('space', 'UsedFor', 'seperation'), ('space', 'HasProperty', 'limitless'), ('space', 'CapableOf', 'separate word')]}, 'answer': ['AtLocation'], 'answer_with_cot': ['To classify the relation between the head entity (\"space\") and the tail entity (\"separate word\"), we need to analyze the graph structure and node information provided in the task.\\n\\nLooking at the triple_list in the graph, we can observe that there is a directed edge from \"space\" to \"separate word\" with the relation \"CapableOf\" - (\"space\" -> \"separate word\")[relation=\"CapableOf\"]. This implies that the head entity (\"space\") is capable of the tail entity (\"separate word\").\\n\\nTherefore, we classify the relation between the head entity and tail entity as \"CapableOf\".'], 'difficulty': 'medium', 'from': 'ConceptNet'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-wikidata5m', 'idx': 39679, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'nature of humanity\\', \\'Modern humans\\', \\'Sexual Orientation\\', \\'Hajime Tabata\\', \\'Catholic Encyclopedia (1913)\\', \\'Common names\\', \\'self-awareness\\', \\'anthropology\\', \\'Iwata, Japan\\', \\'brockhaus and efron encyclopaedia\\', \\'krugosvet\\', \\'worldliness\\', \\'Perſons\\', \\'Huamn\\', \\'Skin tones\\', \\'Prénom\\', \\'Video game development party\\', \\'regional anatomy\\'];\\n    triple_list = [(\"Hajime Tabata\" -> \"Iwata, Japan\")[relation=\"place of birth\"], (\"Hajime Tabata\" -> \"Video game development party\")[relation=\"occupation\"], (\"Huamn\" -> \"brockhaus and efron encyclopaedia\")[relation=\"described by source\"], (\"Huamn\" -> \"Catholic Encyclopedia (1913)\")[relation=\"described by source\"], (\"Huamn\" -> \"krugosvet\")[relation=\"described by source\"], (\"Huamn\" -> \"Modern humans\")[relation=\"said to be the same as\"], (\"Huamn\" -> \"regional anatomy\")[relation=\"has part\"], (\"Huamn\" -> \"Prénom\")[relation=\"has quality\"], (\"Huamn\" -> \"Skin tones\")[relation=\"has quality\"], (\"Huamn\" -> \"self-awareness\")[relation=\"has quality\"], (\"Huamn\" -> \"Sexual Orientation\")[relation=\"has quality\"], (\"Huamn\" -> \"nature of humanity\")[relation=\"has quality\"], (\"Huamn\" -> \"Common names\")[relation=\"instance of\"], (\"Huamn\" -> \"worldliness\")[relation=\"part of\"], (\"Huamn\" -> \"anthropology\")[relation=\"studied by\"], (\"Huamn\" -> \"Perſons\")[relation=\"subclass of\"]];;\\n    head_entity = \"Huamn\";\\n    tail_entity = \"Perſons\";\\n}\\n```\\nTask definition: given one head entity and tail entity and corresponding one-hop knowledge sub-graph, classify the relation between head entity and tail entity into one of \"protocol\", \"platform\", \"occupation\", \"sitter\", \"place of birth\", \"described by source\", \"studied by\", \"mountain range\", \"currency symbol description\", \"subclass of\", \"has part\", \"said to be the same as\", \"part of\", \"instance of\", \"has quality\", \"statistical leader\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'nature of humanity\\', \\'Modern humans\\', \\'Sexual Orientation\\', \\'Hajime Tabata\\', \\'Catholic Encyclopedia (1913)\\', \\'Common names\\', \\'self-awareness\\', \\'anthropology\\', \\'Iwata, Japan\\', \\'brockhaus and efron encyclopaedia\\', \\'krugosvet\\', \\'worldliness\\', \\'Perſons\\', \\'Huamn\\', \\'Skin tones\\', \\'Prénom\\', \\'Video game development party\\', \\'regional anatomy\\'];\\n    triple_list = [(\"Hajime Tabata\" -> \"Iwata, Japan\")[relation=\"place of birth\"], (\"Hajime Tabata\" -> \"Video game development party\")[relation=\"occupation\"], (\"Huamn\" -> \"brockhaus and efron encyclopaedia\")[relation=\"described by source\"], (\"Huamn\" -> \"Catholic Encyclopedia (1913)\")[relation=\"described by source\"], (\"Huamn\" -> \"krugosvet\")[relation=\"described by source\"], (\"Huamn\" -> \"Modern humans\")[relation=\"said to be the same as\"], (\"Huamn\" -> \"regional anatomy\")[relation=\"has part\"], (\"Huamn\" -> \"Prénom\")[relation=\"has quality\"], (\"Huamn\" -> \"Skin tones\")[relation=\"has quality\"], (\"Huamn\" -> \"self-awareness\")[relation=\"has quality\"], (\"Huamn\" -> \"Sexual Orientation\")[relation=\"has quality\"], (\"Huamn\" -> \"nature of humanity\")[relation=\"has quality\"], (\"Huamn\" -> \"Common names\")[relation=\"instance of\"], (\"Huamn\" -> \"worldliness\")[relation=\"part of\"], (\"Huamn\" -> \"anthropology\")[relation=\"studied by\"], (\"Huamn\" -> \"Perſons\")[relation=\"subclass of\"]];;\\n    head_entity = \"Huamn\";\\n    tail_entity = \"Perſons\";\\n}\\n```', 'graph': {'node_list': ['nature of humanity', 'Modern humans', 'Sexual Orientation', 'Hajime Tabata', 'Catholic Encyclopedia (1913)', 'Common names', 'self-awareness', 'anthropology', 'Iwata, Japan', 'brockhaus and efron encyclopaedia', 'krugosvet', 'worldliness', 'Perſons', 'Huamn', 'Skin tones', 'Prénom', 'Video game development party', 'regional anatomy'], 'edge_list': [('Hajime Tabata', 'place of birth', 'Iwata, Japan'), ('Hajime Tabata', 'occupation', 'Video game development party'), ('Huamn', 'described by source', 'brockhaus and efron encyclopaedia'), ('Huamn', 'described by source', 'Catholic Encyclopedia (1913)'), ('Huamn', 'described by source', 'krugosvet'), ('Huamn', 'said to be the same as', 'Modern humans'), ('Huamn', 'has part', 'regional anatomy'), ('Huamn', 'has quality', 'Prénom'), ('Huamn', 'has quality', 'Skin tones'), ('Huamn', 'has quality', 'self-awareness'), ('Huamn', 'has quality', 'Sexual Orientation'), ('Huamn', 'has quality', 'nature of humanity'), ('Huamn', 'instance of', 'Common names'), ('Huamn', 'part of', 'worldliness'), ('Huamn', 'studied by', 'anthropology'), ('Huamn', 'subclass of', 'Perſons')]}, 'answer': ['instance of'], 'answer_with_cot': ['To classify the relation between the head entity \"Huamn\" and the tail entity \"Perſons\" in the given graph, we need to analyze the provided graph information and identify the relation connecting these two entities.\\n\\n1. First, let\\'s analyze the triple_list in the graph:\\n- (\"Hajime Tabata\" -> \"Iwata, Japan\")[relation=\"place of birth\"]: This relation connects \"Hajime Tabata\" and \"Iwata, Japan\" and is labeled as \"place of birth\". It is not directly related to \"Huamn\" or \"Perſons\".\\n\\n- (\"Hajime Tabata\" -> \"Video game development party\")[relation=\"occupation\"]: This relation connects \"Hajime Tabata\" and \"Video game development party\" and is labeled as \"occupation\". It is not directly related to \"Huamn\" or \"Perſons\".\\n\\n- (\"Huamn\" -> \"brockhaus and efron encyclopaedia\")[relation=\"described by source\"]: This relation connects \"Huamn\" and \"brockhaus and efron encyclopaedia\" and is labeled as \"described by source\". It is not directly related to \"Perſons\".\\n\\n- (\"Huamn\" -> \"Catholic Encyclopedia (1913)\")[relation=\"described by source\"]: This relation connects \"Huamn\" and \"Catholic Encyclopedia (1913)\" and is labeled as \"described by source\". It is not directly related to \"Perſons\".\\n\\n- (\"Huamn\" -> \"krugosvet\")[relation=\"described by source\"]: This relation connects \"Huamn\" and \"krugosvet\" and is labeled as \"described by source\". It is not directly related to \"Perſons\".\\n\\n- (\"Huamn\" -> \"Modern humans\")[relation=\"said to be the same as\"]: This relation connects \"Huamn\" and \"Modern humans\" and is labeled as \"said to be the same as\". It is not directly related to \"Perſons\".\\n\\n- (\"Huamn\" -> \"regional anatomy\")[relation=\"has part\"]: This relation connects \"Huamn\" and \"regional anatomy\" and is labeled as \"has part\". It does not match any of the predefined relation categories.\\n\\n- (\"Huamn\" -> \"Prénom\")[relation=\"has quality\"]: This relation connects \"Huamn\" and \"Prénom\" and is labeled as \"has quality\". It does not match any of the predefined relation categories.\\n\\n- (\"Huamn\" -> \"Skin tones\")[relation=\"has quality\"]: This relation connects \"Huamn\" and \"Skin tones\" and is labeled as \"has quality\". It does not match any of the predefined relation categories.\\n\\n- (\"Huamn\" -> \"self-awareness\")[relation=\"has quality\"]: This relation connects \"Huamn\" and \"self-awareness\" and is labeled as \"has quality\". It does not match any of the predefined relation categories.\\n\\n- (\"Huamn\" -> \"Sexual Orientation\")[relation=\"has quality\"]: This relation connects \"Huamn\" and \"Sexual Orientation\" and is labeled as \"has quality\". It does not match any of the predefined relation categories.\\n\\n- (\"Huamn\" -> \"nature of humanity\")[relation=\"has quality\"]: This relation connects \"Huamn\" and \"nature of humanity\" and is labeled as \"has quality\". It does not match any of the predefined relation categories.\\n\\n- (\"Huamn\" -> \"Common names\")[relation=\"instance of\"]: This relation connects \"Huamn\" and \"Common names\" and is labeled as \"instance of\". It does not match any of the predefined relation categories.\\n\\n- (\"Huamn\" -> \"worldliness\")[relation=\"part of\"]: This relation connects \"Huamn\" and \"worldliness\" and is labeled as \"part of\". It does not match any of the predefined relation categories.\\n\\n- (\"Huamn\" -> \"anthropology\")[relation=\"studied by\"]: This relation connects \"Huamn\" and \"anthropology\" and is labeled as \"studied by\". It does not match any of the predefined relation categories.\\n\\n- (\"Huamn\" -> \"Perſons\")[relation=\"subclass of\"]: This relation connects \"Huamn\" and \"Perſons\" and is labeled as \"subclass of\". It is not directly related to \"Perſons\".\\n\\nBased on the given triple_list, none of the available relation labels directly connect \"Huamn\" and \"Perſons\". Therefore, the relation between the head entity \"Huamn\" and the tail entity \"Perſons\" cannot be classified into any of the predefined relation categories (\"protocol\", \"platform\", \"occupation\", \"sitter\", \"place of birth\", \"described by source\", \"studied by\", \"mountain range\", \"currency symbol description\", \"subclass of\", \"has part\", \"said to be the same as\", \"part of\", \"instance of\", \"has quality\", \"statistical leader\").'], 'difficulty': 'medium', 'from': 'Wikidata5M'},\n",
       "       {'task_name': 'graph-language-modeling-graph-question-answering-webquestions', 'idx': 8728, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'Simpson College\\', \\'Chemist\\', \\'United States of America\\', \\'Anemia\\', \\'Date of death\\', \\'Indianola\\', \\'Date of birth\\', \\'Tuskegee University\\', \\'George Washington Carver Academy\\', \\'Carver High School\\', \\'Carver Hall\\', \\'Carver\\', \\'The George Washington Carver Museum\\', \\'Parents\\', \\'Private university\\', \\'USS George Washington Carver (SSBN-656)\\', \\'George Washington Carver\\', \\'George Washington Carver Museum and Cultural Center\\', \\'SS George Washington Carver\\', \\'African American\\', \\'Mary Carver\\', \\'Giles Carver\\', \\'Tuskegee\\', \\'Iowa\\'];\\n    triple_list = [(\"George Washington Carver\" -> \"Carver Hall\")[relation=\"namesakes\"], (\"George Washington Carver\" -> \"Carver High School\")[relation=\"namesakes\"], (\"George Washington Carver\" -> \"George Washington Carver Museum and Cultural Center\")[relation=\"namesakes\"], (\"George Washington Carver\" -> \"Tuskegee University\")[relation=\"organizations founded\"], (\"Simpson College\" -> \"Simpson College\")[relation=\"campuses\"], (\"George Washington Carver\" -> \"George Washington Carver Academy\")[relation=\"namesakes\"], (\"George Washington Carver\" -> \"SS George Washington Carver\")[relation=\"namesakes\"], (\"George Washington Carver\" -> \"USS George Washington Carver (SSBN-656)\")[relation=\"namesakes\"], (\"George Washington Carver\" -> \"Anemia\")[relation=\"cause of death\"], (\"George Washington Carver\" -> \"Chemist\")[relation=\"profession\"], (\"George Washington Carver\" -> \"Tuskegee\")[relation=\"place of death\"], (\"Simpson College\" -> \"Iowa\")[relation=\"containedby\"], (\"George Washington Carver\" -> \"African American\")[relation=\"ethnicity\"], (\"George Washington Carver\" -> \"Mary Carver\")[relation=\"parents\"], (\"George Washington Carver\" -> \"The George Washington Carver Museum\")[relation=\"namesakes\"], (\"George Washington Carver\" -> \"Date of death\")[relation=\"is reviewed\"], (\"Simpson College\" -> \"Indianola\")[relation=\"containedby\"], (\"George Washington Carver\" -> \"George Washington Carver\")[relation=\"image\"], (\"Simpson College\" -> \"Private university\")[relation=\"school type\"], (\"George Washington Carver\" -> \"Carver High School\")[relation=\"namesakes\"], (\"Simpson College\" -> \"Simpson College\")[relation=\"educational institution\"], (\"George Washington Carver\" -> \"Date of birth\")[relation=\"has value\"], (\"George Washington Carver\" -> \"Parents\")[relation=\"is reviewed\"], (\"Simpson College\" -> \"United States of America\")[relation=\"containedby\"], (\"George Washington Carver\" -> \"Giles Carver\")[relation=\"parents\"], (\"George Washington Carver\" -> \"Carver\")[relation=\"namesakes\"]];\\n}\\n```\\nTask definition: given a question and a corresponding knowledge graph, and find an entity in the graph and answer the question.\\nQ: which university attended by george washington carver has the fewest undergraduates ? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'Simpson College\\', \\'Chemist\\', \\'United States of America\\', \\'Anemia\\', \\'Date of death\\', \\'Indianola\\', \\'Date of birth\\', \\'Tuskegee University\\', \\'George Washington Carver Academy\\', \\'Carver High School\\', \\'Carver Hall\\', \\'Carver\\', \\'The George Washington Carver Museum\\', \\'Parents\\', \\'Private university\\', \\'USS George Washington Carver (SSBN-656)\\', \\'George Washington Carver\\', \\'George Washington Carver Museum and Cultural Center\\', \\'SS George Washington Carver\\', \\'African American\\', \\'Mary Carver\\', \\'Giles Carver\\', \\'Tuskegee\\', \\'Iowa\\'];\\n    triple_list = [(\"George Washington Carver\" -> \"Carver Hall\")[relation=\"namesakes\"], (\"George Washington Carver\" -> \"Carver High School\")[relation=\"namesakes\"], (\"George Washington Carver\" -> \"George Washington Carver Museum and Cultural Center\")[relation=\"namesakes\"], (\"George Washington Carver\" -> \"Tuskegee University\")[relation=\"organizations founded\"], (\"Simpson College\" -> \"Simpson College\")[relation=\"campuses\"], (\"George Washington Carver\" -> \"George Washington Carver Academy\")[relation=\"namesakes\"], (\"George Washington Carver\" -> \"SS George Washington Carver\")[relation=\"namesakes\"], (\"George Washington Carver\" -> \"USS George Washington Carver (SSBN-656)\")[relation=\"namesakes\"], (\"George Washington Carver\" -> \"Anemia\")[relation=\"cause of death\"], (\"George Washington Carver\" -> \"Chemist\")[relation=\"profession\"], (\"George Washington Carver\" -> \"Tuskegee\")[relation=\"place of death\"], (\"Simpson College\" -> \"Iowa\")[relation=\"containedby\"], (\"George Washington Carver\" -> \"African American\")[relation=\"ethnicity\"], (\"George Washington Carver\" -> \"Mary Carver\")[relation=\"parents\"], (\"George Washington Carver\" -> \"The George Washington Carver Museum\")[relation=\"namesakes\"], (\"George Washington Carver\" -> \"Date of death\")[relation=\"is reviewed\"], (\"Simpson College\" -> \"Indianola\")[relation=\"containedby\"], (\"George Washington Carver\" -> \"George Washington Carver\")[relation=\"image\"], (\"Simpson College\" -> \"Private university\")[relation=\"school type\"], (\"George Washington Carver\" -> \"Carver High School\")[relation=\"namesakes\"], (\"Simpson College\" -> \"Simpson College\")[relation=\"educational institution\"], (\"George Washington Carver\" -> \"Date of birth\")[relation=\"has value\"], (\"George Washington Carver\" -> \"Parents\")[relation=\"is reviewed\"], (\"Simpson College\" -> \"United States of America\")[relation=\"containedby\"], (\"George Washington Carver\" -> \"Giles Carver\")[relation=\"parents\"], (\"George Washington Carver\" -> \"Carver\")[relation=\"namesakes\"]];\\n}\\n```', 'graph': {'node_list': ['Simpson College', 'Chemist', 'United States of America', 'Anemia', 'Date of death', 'Indianola', 'Date of birth', 'Tuskegee University', 'George Washington Carver Academy', 'Carver High School', 'Carver Hall', 'Carver', 'The George Washington Carver Museum', 'Parents', 'Private university', 'USS George Washington Carver (SSBN-656)', 'George Washington Carver', 'George Washington Carver Museum and Cultural Center', 'SS George Washington Carver', 'African American', 'Mary Carver', 'Giles Carver', 'Tuskegee', 'Iowa'], 'edge_list': [('George Washington Carver', 'namesakes', 'Carver Hall'), ('George Washington Carver', 'namesakes', 'Carver High School'), ('George Washington Carver', 'namesakes', 'George Washington Carver Museum and Cultural Center'), ('George Washington Carver', 'organizations founded', 'Tuskegee University'), ('Simpson College', 'campuses', 'Simpson College'), ('George Washington Carver', 'namesakes', 'George Washington Carver Academy'), ('George Washington Carver', 'namesakes', 'SS George Washington Carver'), ('George Washington Carver', 'namesakes', 'USS George Washington Carver (SSBN-656)'), ('George Washington Carver', 'cause of death', 'Anemia'), ('George Washington Carver', 'profession', 'Chemist'), ('George Washington Carver', 'place of death', 'Tuskegee'), ('Simpson College', 'containedby', 'Iowa'), ('George Washington Carver', 'ethnicity', 'African American'), ('George Washington Carver', 'parents', 'Mary Carver'), ('George Washington Carver', 'namesakes', 'The George Washington Carver Museum'), ('George Washington Carver', 'is reviewed', 'Date of death'), ('Simpson College', 'containedby', 'Indianola'), ('George Washington Carver', 'image', 'George Washington Carver'), ('Simpson College', 'school type', 'Private university'), ('George Washington Carver', 'namesakes', 'Carver High School'), ('Simpson College', 'educational institution', 'Simpson College'), ('George Washington Carver', 'has value', 'Date of birth'), ('George Washington Carver', 'is reviewed', 'Parents'), ('Simpson College', 'containedby', 'United States of America'), ('George Washington Carver', 'parents', 'Giles Carver'), ('George Washington Carver', 'namesakes', 'Carver')]}, 'answer': ['Simpson College'], 'answer_with_cot': ['To find the university attended by George Washington Carver with the fewest undergraduates, we need to analyze the given knowledge graph. \\n\\nFirst, let\\'s identify the nodes related to George Washington Carver:\\n- George Washington Carver\\n- Tuskegee University\\n\\nNext, let\\'s find the relationships between George Washington Carver and the universities:\\n- George Washington Carver is connected to Tuskegee University with the relationship \"organizations founded\".\\n\\nNow, we need to determine the number of undergraduates for each university mentioned in the entity list. However, there is no direct information about the number of undergraduates in the graph.\\n\\nTherefore, without additional information, we cannot determine which university attended by George Washington Carver has the fewest undergraduates.', \"('Simpson College', 'campuses', 'Simpson College')\"], 'difficulty': 'medium', 'from': 'WebQuestions'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-wikidata5m', 'idx': 64040, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'firm (economics)\\', \\'william martin murphy\\', \\'in&m\\', \\'stock exchange council\\', \\'Public limited liability company\\', \\'áth cliath\\', \\'list of tabloids\\', \\'Sister newspaper\\', \\'sunday life (newspaper)\\'];\\n    triple_list = [(\"sunday life (newspaper)\" -> \"Sister newspaper\")[relation=\"instance of\"], (\"sunday life (newspaper)\" -> \"list of tabloids\")[relation=\"newspaper format\"], (\"in&m\" -> \"firm (economics)\")[relation=\"instance of\"], (\"in&m\" -> \"áth cliath\")[relation=\"headquarters location\"], (\"in&m\" -> \"william martin murphy\")[relation=\"founded by\"], (\"in&m\" -> \"stock exchange council\")[relation=\"stock exchange\"], (\"in&m\" -> \"Public limited liability company\")[relation=\"legal form\"]];;\\n    head_entity = \"in&m\";\\n    tail_entity = \"Public limited liability company\";\\n}\\n```\\nTask definition: given one head entity and tail entity and corresponding one-hop knowledge sub-graph, classify the relation between head entity and tail entity into one of \"type of kinship\", \"owned by\", \"source of income\", \"fuel system\", \"legal form\", \"teams classification by time\", \"newspaper format\", \"stock exchange\", \"instance of\", \"cuisine\", \"headquarters location\", \"founded by\", \"species kept\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'firm (economics)\\', \\'william martin murphy\\', \\'in&m\\', \\'stock exchange council\\', \\'Public limited liability company\\', \\'áth cliath\\', \\'list of tabloids\\', \\'Sister newspaper\\', \\'sunday life (newspaper)\\'];\\n    triple_list = [(\"sunday life (newspaper)\" -> \"Sister newspaper\")[relation=\"instance of\"], (\"sunday life (newspaper)\" -> \"list of tabloids\")[relation=\"newspaper format\"], (\"in&m\" -> \"firm (economics)\")[relation=\"instance of\"], (\"in&m\" -> \"áth cliath\")[relation=\"headquarters location\"], (\"in&m\" -> \"william martin murphy\")[relation=\"founded by\"], (\"in&m\" -> \"stock exchange council\")[relation=\"stock exchange\"], (\"in&m\" -> \"Public limited liability company\")[relation=\"legal form\"]];;\\n    head_entity = \"in&m\";\\n    tail_entity = \"Public limited liability company\";\\n}\\n```', 'graph': {'node_list': ['firm (economics)', 'william martin murphy', 'in&m', 'stock exchange council', 'Public limited liability company', 'áth cliath', 'list of tabloids', 'Sister newspaper', 'sunday life (newspaper)'], 'edge_list': [('sunday life (newspaper)', 'instance of', 'Sister newspaper'), ('sunday life (newspaper)', 'newspaper format', 'list of tabloids'), ('in&m', 'instance of', 'firm (economics)'), ('in&m', 'headquarters location', 'áth cliath'), ('in&m', 'founded by', 'william martin murphy'), ('in&m', 'stock exchange', 'stock exchange council'), ('in&m', 'legal form', 'Public limited liability company')]}, 'answer': ['owned by'], 'answer_with_cot': ['To classify the relation between the head entity \"in&m\" and the tail entity \"Public limited liability company\", we can examine the provided one-hop knowledge sub-graph. Here are the steps:\\n\\n1. Identify the edge connecting the head entity and the tail entity:\\n   (in&m -> Public limited liability company)[relation=\"legal form\"]\\n\\n2. Check the relation attribute of the edge:\\n   The relation attribute is \"legal form\".\\n\\n3. Classify the relation based on the given options:\\n   The relation \"legal form\" falls under the category of \"legal form\".\\n\\nTherefore, the relation between the head entity \"in&m\" and the tail entity \"Public limited liability company\" is classified as \"legal form\".'], 'difficulty': 'medium', 'from': 'Wikidata5M'},\n",
       "       {'task_name': 'graph-language-modeling-graph-node-cls-ogbn-arxiv', 'idx': 19420, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"arxiv-scientific-publications-citation-graph\"] {\\n    publication_node_list = [\"paper_2950548233\", \"paper_2951734958\"];\\n    publication_node_feature = [\"paper_2951734958\".feature=\"{\\'year\\': \\'2010\\', \\'title\\': \\'cellsense a probabilistic rssi based gsm positioning system\\', \\'label\\': \\'arxiv.cs.ni\\'}\"];\\n    citation_triple_list = [(\"paper_2951734958\" -> \"paper_2950548233\"), (\"paper_2950548233\" -> \"paper_2951734958\")];\\n    target_publication_node = \"paper_2950548233\";\\n    \"paper_2950548233\".title = \"gac energy efficient hybrid gps accelerometer compass gsm localization\";\\n    \"paper_2950548233\".abstract = \"Adding location to the available information enables a new category of applications. With the constrained battery on cell phones, energy-efficient localization becomes an important challenge. In this paper we introduce a low-energy calibration-free localization scheme based on the available internal sensors in many of today\\'s phones. We start by energy profiling the different sensors that can be used for localization. Based on that, we propose GAC: a hybrid GPS/accelerometer/compass scheme that depends mainly on using the low-energy accelerometer and compass sensors and uses the GPS infrequently for synchronization. We implemented our system on Android-enabled cell phones and evaluated it in both highways and intra-city driving environments. Our results show that the proposed hybrid scheme has an exponential saving in energy, with a linear loss in accuracy compared to the GPS accuracy. We also evaluate the effect of the different parameters on the energy-accuracy tradeoff.\";\\n    \"paper_2950548233\".year = \"2010\";\\n}\\n```\\nTask definition: given a target scientific publication and corresponding citation graph, classify the target scientific publication into one of arxiv.cs.ms, arxiv.cs.ni, arxiv.cs.ir, arxiv.cs.dm, arxiv.cs.mm, arxiv.cs.ne, arxiv.cs.it, arxiv.cs.cr, arxiv.cs.ce, arxiv.cs.pf.\\nQ: Please classify the target scientific publication. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"arxiv-scientific-publications-citation-graph\"] {\\n    publication_node_list = [\"paper_2950548233\", \"paper_2951734958\"];\\n    publication_node_feature = [\"paper_2951734958\".feature=\"{\\'year\\': \\'2010\\', \\'title\\': \\'cellsense a probabilistic rssi based gsm positioning system\\', \\'label\\': \\'arxiv.cs.ni\\'}\"];\\n    citation_triple_list = [(\"paper_2951734958\" -> \"paper_2950548233\"), (\"paper_2950548233\" -> \"paper_2951734958\")];\\n    target_publication_node = \"paper_2950548233\";\\n    \"paper_2950548233\".title = \"gac energy efficient hybrid gps accelerometer compass gsm localization\";\\n    \"paper_2950548233\".abstract = \"Adding location to the available information enables a new category of applications. With the constrained battery on cell phones, energy-efficient localization becomes an important challenge. In this paper we introduce a low-energy calibration-free localization scheme based on the available internal sensors in many of today\\'s phones. We start by energy profiling the different sensors that can be used for localization. Based on that, we propose GAC: a hybrid GPS/accelerometer/compass scheme that depends mainly on using the low-energy accelerometer and compass sensors and uses the GPS infrequently for synchronization. We implemented our system on Android-enabled cell phones and evaluated it in both highways and intra-city driving environments. Our results show that the proposed hybrid scheme has an exponential saving in energy, with a linear loss in accuracy compared to the GPS accuracy. We also evaluate the effect of the different parameters on the energy-accuracy tradeoff.\";\\n    \"paper_2950548233\".year = \"2010\";\\n}\\n```', 'graph': {'node_list': ['2950548233', '2951734958'], 'edge_list': [('2951734958', '2950548233'), ('2950548233', '2951734958')], 'node_feature': {'2951734958': {'year': '2010', 'title': 'cellsense a probabilistic rssi based gsm positioning system', 'label': 'arxiv.cs.ni'}}}, 'answer': ['arxiv.cs.ni'], 'answer_with_cot': ['To classify the target scientific publication, we need to consider its features and its connections in the citation graph. \\n\\nFirst, let\\'s look at the node information of the target publication \"paper_2950548233\":\\n- Title: \"gac energy efficient hybrid gps accelerometer compass gsm localization\"\\n- Abstract: \"Adding location to the available information enables a new category of applications. With the constrained battery on cell phones, energy-efficient localization becomes an important challenge. In this paper we introduce a low-energy calibration-free localization scheme based on the available internal sensors in many of today\\'s phones. We start by energy profiling the different sensors that can be used for localization. Based on that, we propose GAC: a hybrid GPS/accelerometer/compass scheme that depends mainly on using the low-energy accelerometer and compass sensors and uses the GPS infrequently for synchronization. We implemented our system on Android-enabled cell phones and evaluated it in both highways and intra-city driving environments. Our results show that the proposed hybrid scheme has an exponential saving in energy, with a linear loss in accuracy compared to the GPS accuracy. We also evaluate the effect of the different parameters on the energy-accuracy tradeoff.\"\\n- Year: 2010\\n\\nNext, let\\'s consider the connections in the citation graph:\\n- The target publication has two connections with other publications: (\"paper_2951734958\" -> \"paper_2950548233\") and (\"paper_2950548233\" -> \"paper_2951734958\")\\n\\nBased on the provided information, we need to classify the target publication into one of the following categories: arxiv.cs.ms, arxiv.cs.ni, arxiv.cs.ir, arxiv.cs.dm, arxiv.cs.mm, arxiv.cs.ne, arxiv.cs.it, arxiv.cs.cr, arxiv.cs.ce, arxiv.cs.pf.\\n\\nTo perform the classification, we can analyze the label of the connected publication \"paper_2951734958\". According to the provided graph language, the label is \"arxiv.cs.ni\". \\n\\nTherefore, we can classify the target scientific publication \"paper_2950548233\" as \"arxiv.cs.ni\".'], 'difficulty': 'easy', 'from': 'OGBN-ArXiv'},\n",
       "       {'task_name': 'graph-language-modeling-graph-question-answering-pathquestion', 'idx': 718, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'male\\', \\'leeuwarden\\', \\'amsterdam\\', \\'leiden\\', \\'dutch_people\\', \\'tuberculosis\\', \\'saskia_van_uylenburg\\', \\'titus_van_rijn\\', \\'netherlands\\', \\'rembrandt\\', \\'aortic_aneurysm\\', \\'painter\\', \\'artist\\', \\'female\\'];\\n    triple_list = [(\"saskia_van_uylenburg\" -> \"rembrandt\")[relation=\"spouse\"], (\"rembrandt\" -> \"painter\")[relation=\"profession\"], (\"saskia_van_uylenburg\" -> \"tuberculosis\")[relation=\"cause_of_death\"], (\"saskia_van_uylenburg\" -> \"titus_van_rijn\")[relation=\"children\"], (\"titus_van_rijn\" -> \"rembrandt\")[relation=\"parents\"], (\"rembrandt\" -> \"netherlands\")[relation=\"nationality\"], (\"titus_van_rijn\" -> \"netherlands\")[relation=\"nationality\"], (\"saskia_van_uylenburg\" -> \"amsterdam\")[relation=\"place_of_death\"], (\"saskia_van_uylenburg\" -> \"leeuwarden\")[relation=\"place_of_birth\"], (\"saskia_van_uylenburg\" -> \"aortic_aneurysm\")[relation=\"cause_of_death\"], (\"rembrandt\" -> \"saskia_van_uylenburg\")[relation=\"spouse\"], (\"rembrandt\" -> \"amsterdam\")[relation=\"location\"], (\"rembrandt\" -> \"artist\")[relation=\"profession\"], (\"rembrandt\" -> \"dutch_people\")[relation=\"ethnicity\"], (\"rembrandt\" -> \"amsterdam\")[relation=\"place_of_death\"], (\"rembrandt\" -> \"male\")[relation=\"gender\"], (\"titus_van_rijn\" -> \"male\")[relation=\"gender\"], (\"rembrandt\" -> \"leiden\")[relation=\"place_of_birth\"], (\"rembrandt\" -> \"leiden\")[relation=\"location\"], (\"saskia_van_uylenburg\" -> \"leeuwarden\")[relation=\"location\"], (\"saskia_van_uylenburg\" -> \"female\")[relation=\"gender\"], (\"titus_van_rijn\" -> \"saskia_van_uylenburg\")[relation=\"parents\"]];\\n}\\n```\\nTask definition: given a question and factual knowledge graph, find an entity and a reasoning path in the graph to answer the question.\\nQ: what is the titus_van_rijn \\'s father \\'s place of death ? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'male\\', \\'leeuwarden\\', \\'amsterdam\\', \\'leiden\\', \\'dutch_people\\', \\'tuberculosis\\', \\'saskia_van_uylenburg\\', \\'titus_van_rijn\\', \\'netherlands\\', \\'rembrandt\\', \\'aortic_aneurysm\\', \\'painter\\', \\'artist\\', \\'female\\'];\\n    triple_list = [(\"saskia_van_uylenburg\" -> \"rembrandt\")[relation=\"spouse\"], (\"rembrandt\" -> \"painter\")[relation=\"profession\"], (\"saskia_van_uylenburg\" -> \"tuberculosis\")[relation=\"cause_of_death\"], (\"saskia_van_uylenburg\" -> \"titus_van_rijn\")[relation=\"children\"], (\"titus_van_rijn\" -> \"rembrandt\")[relation=\"parents\"], (\"rembrandt\" -> \"netherlands\")[relation=\"nationality\"], (\"titus_van_rijn\" -> \"netherlands\")[relation=\"nationality\"], (\"saskia_van_uylenburg\" -> \"amsterdam\")[relation=\"place_of_death\"], (\"saskia_van_uylenburg\" -> \"leeuwarden\")[relation=\"place_of_birth\"], (\"saskia_van_uylenburg\" -> \"aortic_aneurysm\")[relation=\"cause_of_death\"], (\"rembrandt\" -> \"saskia_van_uylenburg\")[relation=\"spouse\"], (\"rembrandt\" -> \"amsterdam\")[relation=\"location\"], (\"rembrandt\" -> \"artist\")[relation=\"profession\"], (\"rembrandt\" -> \"dutch_people\")[relation=\"ethnicity\"], (\"rembrandt\" -> \"amsterdam\")[relation=\"place_of_death\"], (\"rembrandt\" -> \"male\")[relation=\"gender\"], (\"titus_van_rijn\" -> \"male\")[relation=\"gender\"], (\"rembrandt\" -> \"leiden\")[relation=\"place_of_birth\"], (\"rembrandt\" -> \"leiden\")[relation=\"location\"], (\"saskia_van_uylenburg\" -> \"leeuwarden\")[relation=\"location\"], (\"saskia_van_uylenburg\" -> \"female\")[relation=\"gender\"], (\"titus_van_rijn\" -> \"saskia_van_uylenburg\")[relation=\"parents\"]];\\n}\\n```', 'graph': {'node_list': ['male', 'leeuwarden', 'amsterdam', 'leiden', 'dutch_people', 'tuberculosis', 'saskia_van_uylenburg', 'titus_van_rijn', 'netherlands', 'rembrandt', 'aortic_aneurysm', 'painter', 'artist', 'female'], 'edge_list': [('saskia_van_uylenburg', 'spouse', 'rembrandt'), ('rembrandt', 'profession', 'painter'), ('saskia_van_uylenburg', 'cause_of_death', 'tuberculosis'), ('saskia_van_uylenburg', 'children', 'titus_van_rijn'), ('titus_van_rijn', 'parents', 'rembrandt'), ('rembrandt', 'nationality', 'netherlands'), ('titus_van_rijn', 'nationality', 'netherlands'), ('saskia_van_uylenburg', 'place_of_death', 'amsterdam'), ('saskia_van_uylenburg', 'place_of_birth', 'leeuwarden'), ('saskia_van_uylenburg', 'cause_of_death', 'aortic_aneurysm'), ('rembrandt', 'spouse', 'saskia_van_uylenburg'), ('rembrandt', 'location', 'amsterdam'), ('rembrandt', 'profession', 'artist'), ('rembrandt', 'ethnicity', 'dutch_people'), ('rembrandt', 'place_of_death', 'amsterdam'), ('rembrandt', 'gender', 'male'), ('titus_van_rijn', 'gender', 'male'), ('rembrandt', 'place_of_birth', 'leiden'), ('rembrandt', 'location', 'leiden'), ('saskia_van_uylenburg', 'location', 'leeuwarden'), ('saskia_van_uylenburg', 'gender', 'female'), ('titus_van_rijn', 'parents', 'saskia_van_uylenburg')]}, 'answer': ['amsterdam'], 'answer_with_cot': ['To answer the question, we need to find the place of death of Titus Van Rijn\\'s father. \\n\\n1. We start by finding the node representing Titus Van Rijn (\"titus_van_rijn\").\\n2. Next, we look for outgoing edges from the Titus Van Rijn node to find his parents. We find an edge (\"titus_van_rijn\" -> \"rembrandt\") with the relation \"parents\".\\n3. We then follow the outgoing edge from Rembrandt (\"rembrandt\") to find his place of death. We find an edge (\"rembrandt\" -> \"amsterdam\") with the relation \"place_of_death\".\\n4. Finally, we determine that Rembrandt\\'s place of death is \"amsterdam\".\\n\\nTherefore, the answer to the question \"what is Titus Van Rijn\\'s father\\'s place of death?\" is \"amsterdam\".', \"[('titus_van_rijn', 'parents', 'rembrandt'), ('rembrandt', 'place_of_death', 'amsterdam')]\"], 'difficulty': 'simple', 'from': 'PathQuestion'},\n",
       "       {'task_name': 'graph-structure-modeling-graph-cycle-detection-nlgraph', 'idx': 954, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"cycle-detection\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25];\\n    edge_list = [(0 <-> 18), (2 <-> 0), (3 <-> 12), (13 <-> 14), (20 <-> 21), (24 <-> 11), (4 <-> 24), (16 <-> 17), (9 <-> 20), (25 <-> 24), (7 <-> 10), (8 <-> 23), (13 <-> 3), (24 <-> 18), (2 <-> 22), (23 <-> 9), (14 <-> 0), (16 <-> 23), (22 <-> 12), (0 <-> 1), (0 <-> 10), (0 <-> 5), (2 <-> 15), (16 <-> 3), (1 <-> 25), (19 <-> 23), (17 <-> 6), (3 <-> 0)];\\n}\\n```\\nTask definition: determine if there is a cycle in this graph.\\nQ: Is there a cycle in this graph? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"cycle-detection\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25];\\n    edge_list = [(0 <-> 18), (2 <-> 0), (3 <-> 12), (13 <-> 14), (20 <-> 21), (24 <-> 11), (4 <-> 24), (16 <-> 17), (9 <-> 20), (25 <-> 24), (7 <-> 10), (8 <-> 23), (13 <-> 3), (24 <-> 18), (2 <-> 22), (23 <-> 9), (14 <-> 0), (16 <-> 23), (22 <-> 12), (0 <-> 1), (0 <-> 10), (0 <-> 5), (2 <-> 15), (16 <-> 3), (1 <-> 25), (19 <-> 23), (17 <-> 6), (3 <-> 0)];\\n}\\n```', 'graph': {'node_list': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25], 'edge_list': [('0', '18'), ('2', '0'), ('3', '12'), ('13', '14'), ('20', '21'), ('24', '11'), ('4', '24'), ('16', '17'), ('9', '20'), ('25', '24'), ('7', '10'), ('8', '23'), ('13', '3'), ('24', '18'), ('2', '22'), ('23', '9'), ('14', '0'), ('16', '23'), ('22', '12'), ('0', '1'), ('0', '10'), ('0', '5'), ('2', '15'), ('16', '3'), ('1', '25'), ('19', '23'), ('17', '6'), ('3', '0')]}, 'answer': ['Yes, there is a cycle in this graph.'], 'answer_with_cot': ['To determine if there is a cycle in this graph, we can use a depth-first search (DFS) algorithm. Starting from a node, we visit all its neighbors recursively, marking each visited node as \"visited\". If we encounter a visited node again during the traversal, it means there is a cycle in the graph.\\n\\nLet\\'s go through the graph step by step:\\n1. Start at node 0.\\n2. Visit its neighbor, node 18.\\n3. Visit node 18\\'s neighbor, node 24.\\n4. Visit node 24\\'s neighbor, node 11.\\n5. Visit node 11\\'s neighbor, which is node 24 (already visited). This indicates a cycle.\\n\\nTherefore, there is a cycle in this graph.'], 'difficulty': 'hard', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-language-modeling-graph-node-cls-ogbn-products', 'idx': 1431, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"product-graph\"] {\\n    product_node_list = [\"B00CMA2FIG\", \"B000FDFCLO\", \"B00D6AQSBG\", \"B008L5FO66\", \"B006HUX9IM\", \"B001SJYKR6\", \"B000W6ZOKS\", \"B00AWU2T3O\", \"B000UO9B2O\", \"B008L264Q8\", \"B004GBK324\", \"B002STKMIG\", \"B000LC57F0\", \"B008XO4O7U\", \"B0048CK2KE\", \"B000HIHQ02\", \"B000HIJMQI\", \"B004D07A7O\", \"B00FWXMSDW\", \"B003F31A5I\", \"B000E6DUV6\", \"B003QVRX14\", \"B006HBXIQ4\"];\\n    product_node_feature = [\"B000FDFCLO\".category=\"Toys.&.Games\", \"B00D6AQSBG\".category=\"Toys.&.Games\", \"B008L5FO66\".category=\"\", \"B006HUX9IM\".category=\"\", \"B001SJYKR6\".category=\"Toys.&.Games\", \"B000W6ZOKS\".category=\"Toys.&.Games\", \"B00AWU2T3O\".category=\"Toys.&.Games\", \"B000UO9B2O\".category=\"Toys.&.Games\", \"B008L264Q8\".category=\"Toys.&.Games\", \"B004GBK324\".category=\"Toys.&.Games\", \"B002STKMIG\".category=\"Office.Products\", \"B000LC57F0\".category=\"Toys.&.Games\", \"B008XO4O7U\".category=\"Toys.&.Games\", \"B0048CK2KE\".category=\"Home.&.Kitchen\", \"B000HIHQ02\".category=\"Toys.&.Games\", \"B000HIJMQI\".category=\"Toys.&.Games\", \"B004D07A7O\".category=\"Clothing,.Shoes.&.Jewelry\", \"B00FWXMSDW\".category=\"Toys.&.Games\", \"B003F31A5I\".category=\"Toys.&.Games\", \"B000E6DUV6\".category=\"Toys.&.Games\", \"B003QVRX14\".category=\"Toys.&.Games\", \"B006HBXIQ4\".category=\"Toys.&.Games\"];\\n    product_triple_list = [(\"B000FDFCLO\" -> \"B00D6AQSBG\"), (\"B008L5FO66\" -> \"B006HUX9IM\"), (\"B001SJYKR6\" -> \"B000W6ZOKS\"), (\"B00CMA2FIG\" -> \"B008L5FO66\"), (\"B000FDFCLO\" -> \"B00AWU2T3O\"), (\"B000UO9B2O\" -> \"B008L264Q8\"), (\"B000FDFCLO\" -> \"B004GBK324\"), (\"B008L5FO66\" -> \"B002STKMIG\"), (\"B00CMA2FIG\" -> \"B001SJYKR6\"), (\"B000UO9B2O\" -> \"B000LC57F0\"), (\"B00CMA2FIG\" -> \"B000UO9B2O\"), (\"B000UO9B2O\" -> \"B008XO4O7U\"), (\"B008L5FO66\" -> \"B0048CK2KE\"), (\"B000FDFCLO\" -> \"B000HIHQ02\"), (\"B00CMA2FIG\" -> \"B000HIJMQI\"), (\"B008L5FO66\" -> \"B004D07A7O\"), (\"B001SJYKR6\" -> \"B00FWXMSDW\"), (\"B000UO9B2O\" -> \"B003F31A5I\"), (\"B000FDFCLO\" -> \"B000E6DUV6\"), (\"B00CMA2FIG\" -> \"B000FDFCLO\"), (\"B008L5FO66\" -> \"B003QVRX14\"), (\"B000UO9B2O\" -> \"B006HBXIQ4\")];\\n    target_product_node = \"B00CMA2FIG\";\\n}\\n```\\nTask definition: given a product and corresponding graph, classify the target product into one of #508510, Car.Electronics, Toys.&.Games, Digital.Music, Patio,.Lawn.&.Garden, Collectibles.&.Fine.Art, All.Electronics, Movies.&.TV, Kitchen.&.Dining, Furniture.&.D&#233;cor.\\nQ: Please classify the target product. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"product-graph\"] {\\n    product_node_list = [\"B00CMA2FIG\", \"B000FDFCLO\", \"B00D6AQSBG\", \"B008L5FO66\", \"B006HUX9IM\", \"B001SJYKR6\", \"B000W6ZOKS\", \"B00AWU2T3O\", \"B000UO9B2O\", \"B008L264Q8\", \"B004GBK324\", \"B002STKMIG\", \"B000LC57F0\", \"B008XO4O7U\", \"B0048CK2KE\", \"B000HIHQ02\", \"B000HIJMQI\", \"B004D07A7O\", \"B00FWXMSDW\", \"B003F31A5I\", \"B000E6DUV6\", \"B003QVRX14\", \"B006HBXIQ4\"];\\n    product_node_feature = [\"B000FDFCLO\".category=\"Toys.&.Games\", \"B00D6AQSBG\".category=\"Toys.&.Games\", \"B008L5FO66\".category=\"\", \"B006HUX9IM\".category=\"\", \"B001SJYKR6\".category=\"Toys.&.Games\", \"B000W6ZOKS\".category=\"Toys.&.Games\", \"B00AWU2T3O\".category=\"Toys.&.Games\", \"B000UO9B2O\".category=\"Toys.&.Games\", \"B008L264Q8\".category=\"Toys.&.Games\", \"B004GBK324\".category=\"Toys.&.Games\", \"B002STKMIG\".category=\"Office.Products\", \"B000LC57F0\".category=\"Toys.&.Games\", \"B008XO4O7U\".category=\"Toys.&.Games\", \"B0048CK2KE\".category=\"Home.&.Kitchen\", \"B000HIHQ02\".category=\"Toys.&.Games\", \"B000HIJMQI\".category=\"Toys.&.Games\", \"B004D07A7O\".category=\"Clothing,.Shoes.&.Jewelry\", \"B00FWXMSDW\".category=\"Toys.&.Games\", \"B003F31A5I\".category=\"Toys.&.Games\", \"B000E6DUV6\".category=\"Toys.&.Games\", \"B003QVRX14\".category=\"Toys.&.Games\", \"B006HBXIQ4\".category=\"Toys.&.Games\"];\\n    product_triple_list = [(\"B000FDFCLO\" -> \"B00D6AQSBG\"), (\"B008L5FO66\" -> \"B006HUX9IM\"), (\"B001SJYKR6\" -> \"B000W6ZOKS\"), (\"B00CMA2FIG\" -> \"B008L5FO66\"), (\"B000FDFCLO\" -> \"B00AWU2T3O\"), (\"B000UO9B2O\" -> \"B008L264Q8\"), (\"B000FDFCLO\" -> \"B004GBK324\"), (\"B008L5FO66\" -> \"B002STKMIG\"), (\"B00CMA2FIG\" -> \"B001SJYKR6\"), (\"B000UO9B2O\" -> \"B000LC57F0\"), (\"B00CMA2FIG\" -> \"B000UO9B2O\"), (\"B000UO9B2O\" -> \"B008XO4O7U\"), (\"B008L5FO66\" -> \"B0048CK2KE\"), (\"B000FDFCLO\" -> \"B000HIHQ02\"), (\"B00CMA2FIG\" -> \"B000HIJMQI\"), (\"B008L5FO66\" -> \"B004D07A7O\"), (\"B001SJYKR6\" -> \"B00FWXMSDW\"), (\"B000UO9B2O\" -> \"B003F31A5I\"), (\"B000FDFCLO\" -> \"B000E6DUV6\"), (\"B00CMA2FIG\" -> \"B000FDFCLO\"), (\"B008L5FO66\" -> \"B003QVRX14\"), (\"B000UO9B2O\" -> \"B006HBXIQ4\")];\\n    target_product_node = \"B00CMA2FIG\";\\n}\\n```', 'graph': {'node_list': ['B00CMA2FIG', 'B000FDFCLO', 'B00D6AQSBG', 'B008L5FO66', 'B006HUX9IM', 'B001SJYKR6', 'B000W6ZOKS', 'B00AWU2T3O', 'B000UO9B2O', 'B008L264Q8', 'B004GBK324', 'B002STKMIG', 'B000LC57F0', 'B008XO4O7U', 'B0048CK2KE', 'B000HIHQ02', 'B000HIJMQI', 'B004D07A7O', 'B00FWXMSDW', 'B003F31A5I', 'B000E6DUV6', 'B003QVRX14', 'B006HBXIQ4'], 'edge_list': [('B000FDFCLO', 'B00D6AQSBG'), ('B008L5FO66', 'B006HUX9IM'), ('B001SJYKR6', 'B000W6ZOKS'), ('B00CMA2FIG', 'B008L5FO66'), ('B000FDFCLO', 'B00AWU2T3O'), ('B000UO9B2O', 'B008L264Q8'), ('B000FDFCLO', 'B004GBK324'), ('B008L5FO66', 'B002STKMIG'), ('B00CMA2FIG', 'B001SJYKR6'), ('B000UO9B2O', 'B000LC57F0'), ('B00CMA2FIG', 'B000UO9B2O'), ('B000UO9B2O', 'B008XO4O7U'), ('B008L5FO66', 'B0048CK2KE'), ('B000FDFCLO', 'B000HIHQ02'), ('B00CMA2FIG', 'B000HIJMQI'), ('B008L5FO66', 'B004D07A7O'), ('B001SJYKR6', 'B00FWXMSDW'), ('B000UO9B2O', 'B003F31A5I'), ('B000FDFCLO', 'B000E6DUV6'), ('B00CMA2FIG', 'B000FDFCLO'), ('B008L5FO66', 'B003QVRX14'), ('B000UO9B2O', 'B006HBXIQ4')], 'node_feature': {'B000FDFCLO': {'label': 'Toys.&.Games'}, 'B00D6AQSBG': {'label': 'Toys.&.Games'}, 'B008L5FO66': {'label': ''}, 'B006HUX9IM': {'label': ''}, 'B001SJYKR6': {'label': 'Toys.&.Games'}, 'B000W6ZOKS': {'label': 'Toys.&.Games'}, 'B00AWU2T3O': {'label': 'Toys.&.Games'}, 'B000UO9B2O': {'label': 'Toys.&.Games'}, 'B008L264Q8': {'label': 'Toys.&.Games'}, 'B004GBK324': {'label': 'Toys.&.Games'}, 'B002STKMIG': {'label': 'Office.Products'}, 'B000LC57F0': {'label': 'Toys.&.Games'}, 'B008XO4O7U': {'label': 'Toys.&.Games'}, 'B0048CK2KE': {'label': 'Home.&.Kitchen'}, 'B000HIHQ02': {'label': 'Toys.&.Games'}, 'B000HIJMQI': {'label': 'Toys.&.Games'}, 'B004D07A7O': {'label': 'Clothing,.Shoes.&.Jewelry'}, 'B00FWXMSDW': {'label': 'Toys.&.Games'}, 'B003F31A5I': {'label': 'Toys.&.Games'}, 'B000E6DUV6': {'label': 'Toys.&.Games'}, 'B003QVRX14': {'label': 'Toys.&.Games'}, 'B006HBXIQ4': {'label': 'Toys.&.Games'}}}, 'answer': ['Toys.&.Games'], 'answer_with_cot': ['To classify the target product (\"B00CMA2FIG\") into one of the categories mentioned (#508510, Car.Electronics, Toys.&.Games, Digital.Music, Patio,.Lawn.&.Garden, Collectibles.&.Fine.Art, All.Electronics, Movies.&.TV, Kitchen.&.Dining, Furniture.&.D&#233;cor), we can start by analyzing its connections within the graph.\\n\\nFirst, let\\'s find the target product (\"B00CMA2FIG\") in the graph. We can see that it is connected to several other products: \"B008L5FO66\", \"B001SJYKR6\", \"B000FDFCLO\", \"B00AWU2T3O\", \"B004GBK324\", \"B001SJYKR6\", \"B000HIJMQI\", \"B004D07A7O\", \"B003QVRX14\", \"B006HBXIQ4\".\\n\\nNext, we can look at the categories of these connected products to help classify the target product. Here are the categories of the connected products:\\n- \"B008L5FO66\" - No category information provided.\\n- \"B001SJYKR6\" - Toys & Games\\n- \"B000FDFCLO\" - Toys & Games\\n- \"B00AWU2T3O\" - Toys & Games\\n- \"B004GBK324\" - Toys & Games\\n- \"B001SJYKR6\" - Toys & Games\\n- \"B000HIJMQI\" - Toys & Games\\n- \"B004D07A7O\" - Clothing, Shoes & Jewelry\\n- \"B003QVRX14\" - Toys & Games\\n- \"B006HBXIQ4\" - Toys & Games\\n\\nBased on the category information of the connected products, we can see that the majority of them (except for \"B004D07A7O\") fall into the \"Toys & Games\" category. Therefore, it is likely that the target product \"B00CMA2FIG\" also belongs to the \"Toys & Games\" category.\\n\\nTherefore, the classification of the target product \"B00CMA2FIG\" is \"Toys & Games\".'], 'difficulty': 'easy', 'from': 'OGBN-Products'},\n",
       "       {'task_name': 'graph-structure-modeling-graph-hamilton-path-nlgraph', 'idx': 197, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"hamilton-path\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];\\n    edge_list = [(0 <-> 9), (0 <-> 12), (0 <-> 4), (0 <-> 8), (0 <-> 5), (0 <-> 2), (0 <-> 10), (0 <-> 7), (0 <-> 11), (0 <-> 3), (0 <-> 13), (1 <-> 10), (1 <-> 13), (1 <-> 8), (1 <-> 3), (2 <-> 13), (2 <-> 7), (2 <-> 11), (2 <-> 4), (3 <-> 10), (3 <-> 4), (3 <-> 8), (3 <-> 11), (3 <-> 7), (3 <-> 9), (4 <-> 5), (4 <-> 12), (4 <-> 8), (5 <-> 11), (5 <-> 7), (5 <-> 9), (5 <-> 13), (5 <-> 6), (5 <-> 12), (6 <-> 11), (6 <-> 9), (6 <-> 8), (7 <-> 9), (7 <-> 8), (8 <-> 10), (8 <-> 9), (9 <-> 10), (10 <-> 13), (10 <-> 11), (11 <-> 12), (11 <-> 13), (12 <-> 13)];\\n}\\n```\\nTask definition: determine if there is a path that visits every node exactly once in this graph.\\nQ: Is there a path in this graph that visits every node exactly once? If yes, give the path. Note that in a path, adjacent nodes must be connected with edges. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"hamilton-path\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];\\n    edge_list = [(0 <-> 9), (0 <-> 12), (0 <-> 4), (0 <-> 8), (0 <-> 5), (0 <-> 2), (0 <-> 10), (0 <-> 7), (0 <-> 11), (0 <-> 3), (0 <-> 13), (1 <-> 10), (1 <-> 13), (1 <-> 8), (1 <-> 3), (2 <-> 13), (2 <-> 7), (2 <-> 11), (2 <-> 4), (3 <-> 10), (3 <-> 4), (3 <-> 8), (3 <-> 11), (3 <-> 7), (3 <-> 9), (4 <-> 5), (4 <-> 12), (4 <-> 8), (5 <-> 11), (5 <-> 7), (5 <-> 9), (5 <-> 13), (5 <-> 6), (5 <-> 12), (6 <-> 11), (6 <-> 9), (6 <-> 8), (7 <-> 9), (7 <-> 8), (8 <-> 10), (8 <-> 9), (9 <-> 10), (10 <-> 13), (10 <-> 11), (11 <-> 12), (11 <-> 13), (12 <-> 13)];\\n}\\n```', 'graph': {'node_list': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], 'edge_list': [('0', '9'), ('0', '12'), ('0', '4'), ('0', '8'), ('0', '5'), ('0', '2'), ('0', '10'), ('0', '7'), ('0', '11'), ('0', '3'), ('0', '13'), ('1', '10'), ('1', '13'), ('1', '8'), ('1', '3'), ('2', '13'), ('2', '7'), ('2', '11'), ('2', '4'), ('3', '10'), ('3', '4'), ('3', '8'), ('3', '11'), ('3', '7'), ('3', '9'), ('4', '5'), ('4', '12'), ('4', '8'), ('5', '11'), ('5', '7'), ('5', '9'), ('5', '13'), ('5', '6'), ('5', '12'), ('6', '11'), ('6', '9'), ('6', '8'), ('7', '9'), ('7', '8'), ('8', '10'), ('8', '9'), ('9', '10'), ('10', '13'), ('10', '11'), ('11', '12'), ('11', '13'), ('12', '13')]}, 'answer': ['Yes. The path can be: 0,13,12,11,10,9,8,6,5,7,2,4,3,1'], 'answer_with_cot': ['To determine if there is a path that visits every node exactly once in this graph, we can use a Depth-First Search (DFS) algorithm.\\n\\nStarting from node 0, we can perform a DFS traversal of the graph, visiting each unvisited neighbor of the current node until all nodes have been visited. If all nodes have been visited after the DFS traversal, then there exists a path that visits every node exactly once.\\n\\nHere is the path that visits every node exactly once in this graph:\\n0 -> 9 -> 3 -> 1 -> 8 -> 4 -> 12 -> 5 -> 13 -> 10 -> 2 -> 7 -> 11 -> 6'], 'difficulty': 'hard', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-language-modeling-graph-node-cls-ogbn-products', 'idx': 7126, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"product-graph\"] {\\n    product_node_list = [\"1250034604\", \"1250045134\", \"1250043891\", \"0778313883\", \"125002479X\", \"0062311077\", \"0857520792\", \"0399167064\", \"0316126381\", \"0061013706\", \"0061576638\", \"0765336359\", \"1594633177\", \"0307961257\", \"0385534833\", \"0316405345\", \"0061576603\", \"0099460297\", \"0345535243\", \"0312642318\", \"1477807756\", \"0316033782\", \"1451678711\", \"1455527602\", \"0778314480\", \"1477820051\", \"1409121259\", \"1477809449\", \"1477848347\", \"0345406680\", \"0316187429\"];\\n    product_node_feature = [\"1250045134\".category=\"Books\", \"1250043891\".category=\"Books\", \"0778313883\".category=\"Books\", \"125002479X\".category=\"Books\", \"0062311077\".category=\"Books\", \"0857520792\".category=\"Books\", \"0399167064\".category=\"Books\", \"0316126381\".category=\"Books\", \"0061013706\".category=\"Books\", \"0061576638\".category=\"Books\", \"0765336359\".category=\"Books\", \"1594633177\".category=\"Books\", \"0307961257\".category=\"Books\", \"0385534833\".category=\"Books\", \"0316405345\".category=\"Books\", \"0061576603\".category=\"Books\", \"0099460297\".category=\"Books\", \"0345535243\".category=\"Books\", \"0312642318\".category=\"Books\", \"1477807756\".category=\"Books\", \"0316033782\".category=\"Books\", \"1451678711\".category=\"Books\", \"1455527602\".category=\"Books\", \"0778314480\".category=\"Books\", \"1477820051\".category=\"Books\", \"1409121259\".category=\"Books\", \"1477809449\".category=\"Books\", \"1477848347\".category=\"Books\", \"0345406680\".category=\"Books\", \"0316187429\".category=\"Books\"];\\n    product_triple_list = [(\"1250045134\" -> \"1250043891\"), (\"1250045134\" -> \"0778313883\"), (\"1250034604\" -> \"125002479X\"), (\"0062311077\" -> \"0857520792\"), (\"1250045134\" -> \"0399167064\"), (\"125002479X\" -> \"0316126381\"), (\"0062311077\" -> \"0061013706\"), (\"0061576638\" -> \"0765336359\"), (\"1250045134\" -> \"1594633177\"), (\"125002479X\" -> \"0307961257\"), (\"0061576638\" -> \"0385534833\"), (\"0061576638\" -> \"0316405345\"), (\"0061576638\" -> \"0061576603\"), (\"0061576638\" -> \"0099460297\"), (\"0062311077\" -> \"0345535243\"), (\"1250034604\" -> \"0062311077\"), (\"1250034604\" -> \"0061576638\"), (\"125002479X\" -> \"0312642318\"), (\"1250034604\" -> \"1477807756\"), (\"0062311077\" -> \"0316033782\"), (\"1250034604\" -> \"1250045134\"), (\"1477807756\" -> \"1451678711\"), (\"1477807756\" -> \"1455527602\"), (\"1250045134\" -> \"0778314480\"), (\"1477807756\" -> \"1477820051\"), (\"125002479X\" -> \"1409121259\"), (\"1477807756\" -> \"1477809449\"), (\"1477807756\" -> \"1477848347\"), (\"0062311077\" -> \"0345406680\"), (\"125002479X\" -> \"0316187429\")];\\n    target_product_node = \"1250034604\";\\n}\\n```\\nTask definition: given a product and corresponding graph, classify the target product into one of All.Beauty, Automotive, Office.Products, Digital.Music, Tools.&.Home.Improvement, Furniture.&.D&#233;cor, Computers, Appliances, Books, Health.&.Personal.Care.\\nQ: Please classify the target product. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"product-graph\"] {\\n    product_node_list = [\"1250034604\", \"1250045134\", \"1250043891\", \"0778313883\", \"125002479X\", \"0062311077\", \"0857520792\", \"0399167064\", \"0316126381\", \"0061013706\", \"0061576638\", \"0765336359\", \"1594633177\", \"0307961257\", \"0385534833\", \"0316405345\", \"0061576603\", \"0099460297\", \"0345535243\", \"0312642318\", \"1477807756\", \"0316033782\", \"1451678711\", \"1455527602\", \"0778314480\", \"1477820051\", \"1409121259\", \"1477809449\", \"1477848347\", \"0345406680\", \"0316187429\"];\\n    product_node_feature = [\"1250045134\".category=\"Books\", \"1250043891\".category=\"Books\", \"0778313883\".category=\"Books\", \"125002479X\".category=\"Books\", \"0062311077\".category=\"Books\", \"0857520792\".category=\"Books\", \"0399167064\".category=\"Books\", \"0316126381\".category=\"Books\", \"0061013706\".category=\"Books\", \"0061576638\".category=\"Books\", \"0765336359\".category=\"Books\", \"1594633177\".category=\"Books\", \"0307961257\".category=\"Books\", \"0385534833\".category=\"Books\", \"0316405345\".category=\"Books\", \"0061576603\".category=\"Books\", \"0099460297\".category=\"Books\", \"0345535243\".category=\"Books\", \"0312642318\".category=\"Books\", \"1477807756\".category=\"Books\", \"0316033782\".category=\"Books\", \"1451678711\".category=\"Books\", \"1455527602\".category=\"Books\", \"0778314480\".category=\"Books\", \"1477820051\".category=\"Books\", \"1409121259\".category=\"Books\", \"1477809449\".category=\"Books\", \"1477848347\".category=\"Books\", \"0345406680\".category=\"Books\", \"0316187429\".category=\"Books\"];\\n    product_triple_list = [(\"1250045134\" -> \"1250043891\"), (\"1250045134\" -> \"0778313883\"), (\"1250034604\" -> \"125002479X\"), (\"0062311077\" -> \"0857520792\"), (\"1250045134\" -> \"0399167064\"), (\"125002479X\" -> \"0316126381\"), (\"0062311077\" -> \"0061013706\"), (\"0061576638\" -> \"0765336359\"), (\"1250045134\" -> \"1594633177\"), (\"125002479X\" -> \"0307961257\"), (\"0061576638\" -> \"0385534833\"), (\"0061576638\" -> \"0316405345\"), (\"0061576638\" -> \"0061576603\"), (\"0061576638\" -> \"0099460297\"), (\"0062311077\" -> \"0345535243\"), (\"1250034604\" -> \"0062311077\"), (\"1250034604\" -> \"0061576638\"), (\"125002479X\" -> \"0312642318\"), (\"1250034604\" -> \"1477807756\"), (\"0062311077\" -> \"0316033782\"), (\"1250034604\" -> \"1250045134\"), (\"1477807756\" -> \"1451678711\"), (\"1477807756\" -> \"1455527602\"), (\"1250045134\" -> \"0778314480\"), (\"1477807756\" -> \"1477820051\"), (\"125002479X\" -> \"1409121259\"), (\"1477807756\" -> \"1477809449\"), (\"1477807756\" -> \"1477848347\"), (\"0062311077\" -> \"0345406680\"), (\"125002479X\" -> \"0316187429\")];\\n    target_product_node = \"1250034604\";\\n}\\n```', 'graph': {'node_list': ['1250034604', '1250045134', '1250043891', '0778313883', '125002479X', '0062311077', '0857520792', '0399167064', '0316126381', '0061013706', '0061576638', '0765336359', '1594633177', '0307961257', '0385534833', '0316405345', '0061576603', '0099460297', '0345535243', '0312642318', '1477807756', '0316033782', '1451678711', '1455527602', '0778314480', '1477820051', '1409121259', '1477809449', '1477848347', '0345406680', '0316187429'], 'edge_list': [('1250045134', '1250043891'), ('1250045134', '0778313883'), ('1250034604', '125002479X'), ('0062311077', '0857520792'), ('1250045134', '0399167064'), ('125002479X', '0316126381'), ('0062311077', '0061013706'), ('0061576638', '0765336359'), ('1250045134', '1594633177'), ('125002479X', '0307961257'), ('0061576638', '0385534833'), ('0061576638', '0316405345'), ('0061576638', '0061576603'), ('0061576638', '0099460297'), ('0062311077', '0345535243'), ('1250034604', '0062311077'), ('1250034604', '0061576638'), ('125002479X', '0312642318'), ('1250034604', '1477807756'), ('0062311077', '0316033782'), ('1250034604', '1250045134'), ('1477807756', '1451678711'), ('1477807756', '1455527602'), ('1250045134', '0778314480'), ('1477807756', '1477820051'), ('125002479X', '1409121259'), ('1477807756', '1477809449'), ('1477807756', '1477848347'), ('0062311077', '0345406680'), ('125002479X', '0316187429')], 'node_feature': {'1250045134': {'label': 'Books'}, '1250043891': {'label': 'Books'}, '0778313883': {'label': 'Books'}, '125002479X': {'label': 'Books'}, '0062311077': {'label': 'Books'}, '0857520792': {'label': 'Books'}, '0399167064': {'label': 'Books'}, '0316126381': {'label': 'Books'}, '0061013706': {'label': 'Books'}, '0061576638': {'label': 'Books'}, '0765336359': {'label': 'Books'}, '1594633177': {'label': 'Books'}, '0307961257': {'label': 'Books'}, '0385534833': {'label': 'Books'}, '0316405345': {'label': 'Books'}, '0061576603': {'label': 'Books'}, '0099460297': {'label': 'Books'}, '0345535243': {'label': 'Books'}, '0312642318': {'label': 'Books'}, '1477807756': {'label': 'Books'}, '0316033782': {'label': 'Books'}, '1451678711': {'label': 'Books'}, '1455527602': {'label': 'Books'}, '0778314480': {'label': 'Books'}, '1477820051': {'label': 'Books'}, '1409121259': {'label': 'Books'}, '1477809449': {'label': 'Books'}, '1477848347': {'label': 'Books'}, '0345406680': {'label': 'Books'}, '0316187429': {'label': 'Books'}}}, 'answer': ['Books'], 'answer_with_cot': ['To classify the target product, we need to determine its category based on the given graph and the node information.\\n\\nFirst, let\\'s analyze the graph structure. The \"product_triple_list\" describes the connections between products. For example, (\"1250045134\" -> \"1250043891\") means that \"1250045134\" is connected to \"1250043891\" with a directed edge. Similarly, (\"1250034604\" -> \"125002479X\") means that \"1250034604\" is connected to \"125002479X\" with a directed edge.\\n\\nNext, let\\'s examine the node information. Each product node is associated with a category. For example, \"1250045134\".category=\"Books\" indicates that the product \"1250045134\" belongs to the category \"Books\".\\n\\nNow, we can determine the category of the target product \"1250034604\" by following its connections in the graph. Starting from \"1250034604\", we see that it is connected to \"125002479X\" and \"0062311077\". Following these connections, we find that \"125002479X\" is connected to \"0316126381\" and \"0307961257\", while \"0062311077\" is connected to \"0857520792\", \"0061013706\", \"0345535243\", \"0316033782\", \"0316187429\", and \"0385534833\".\\n\\nBased on the category information, we can determine the category of each connected product node. Then, we can use this information to classify the target product \"1250034604\".\\n\\nBy examining the node information and the categories of connected products, we find that all the connected products belong to the category \"Books\". Therefore, we can classify the target product \"1250034604\" as \"Books\".'], 'difficulty': 'easy', 'from': 'OGBN-Products'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-wikidata5m', 'idx': 67466, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'professions\\', \\'waldo (first name)\\', \\'united stated\\', \\'engineering (skill)\\', \\'Waldo Dean Waterman\\', \\'list of famous engineer\\', \\'Lists of engineers\\', \\'Huamn\\', \\'ISO 10\\'];\\n    triple_list = [(\"Waldo Dean Waterman\" -> \"united stated\")[relation=\"country of citizenship\"], (\"Waldo Dean Waterman\" -> \"Huamn\")[relation=\"instance of\"], (\"Waldo Dean Waterman\" -> \"waldo (first name)\")[relation=\"given name\"], (\"list of famous engineer\" -> \"Lists of engineers\")[relation=\"has list\"], (\"list of famous engineer\" -> \"ISO 10\")[relation=\"item operated\"], (\"list of famous engineer\" -> \"engineering (skill)\")[relation=\"field of this occupation\"], (\"list of famous engineer\" -> \"professions\")[relation=\"instance of\"]];;\\n    head_entity = \"list of famous engineer\";\\n    tail_entity = \"professions\";\\n}\\n```\\nTask definition: given one head entity and tail entity and corresponding one-hop knowledge sub-graph, classify the relation between head entity and tail entity into one of \"practiced by\", \"territory claimed by\", \"occupation\", \"interleaves with\", \"item operated\", \"index case of\", \"country of citizenship\", \"given name\", \"Catholic rite\", \"instance of\", \"composer\", \"field of this occupation\", \"has list\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'professions\\', \\'waldo (first name)\\', \\'united stated\\', \\'engineering (skill)\\', \\'Waldo Dean Waterman\\', \\'list of famous engineer\\', \\'Lists of engineers\\', \\'Huamn\\', \\'ISO 10\\'];\\n    triple_list = [(\"Waldo Dean Waterman\" -> \"united stated\")[relation=\"country of citizenship\"], (\"Waldo Dean Waterman\" -> \"Huamn\")[relation=\"instance of\"], (\"Waldo Dean Waterman\" -> \"waldo (first name)\")[relation=\"given name\"], (\"list of famous engineer\" -> \"Lists of engineers\")[relation=\"has list\"], (\"list of famous engineer\" -> \"ISO 10\")[relation=\"item operated\"], (\"list of famous engineer\" -> \"engineering (skill)\")[relation=\"field of this occupation\"], (\"list of famous engineer\" -> \"professions\")[relation=\"instance of\"]];;\\n    head_entity = \"list of famous engineer\";\\n    tail_entity = \"professions\";\\n}\\n```', 'graph': {'node_list': ['professions', 'waldo (first name)', 'united stated', 'engineering (skill)', 'Waldo Dean Waterman', 'list of famous engineer', 'Lists of engineers', 'Huamn', 'ISO 10'], 'edge_list': [('Waldo Dean Waterman', 'country of citizenship', 'united stated'), ('Waldo Dean Waterman', 'instance of', 'Huamn'), ('Waldo Dean Waterman', 'given name', 'waldo (first name)'), ('list of famous engineer', 'has list', 'Lists of engineers'), ('list of famous engineer', 'item operated', 'ISO 10'), ('list of famous engineer', 'field of this occupation', 'engineering (skill)'), ('list of famous engineer', 'instance of', 'professions')]}, 'answer': ['occupation'], 'answer_with_cot': ['To classify the relation between the head entity (\"list of famous engineer\") and the tail entity (\"professions\"), let\\'s examine the provided graph language.\\n\\nThe given graph contains information about entities and their relationships. We can see that the head entity is connected to the tail entity through a directed edge in the form of (\"list of famous engineer\" -> \"professions\"). The relationship between these entities is described using the attribute [relation=\"instance of\"].\\n\\nBased on this information, we can classify the relation between the head entity and tail entity as \"instance of\".'], 'difficulty': 'medium', 'from': 'Wikidata5M'},\n",
       "       {'task_name': 'graph-language-modeling-graph-node-cls-ogbn-products', 'idx': 13859, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"product-graph\"] {\\n    product_node_list = [\"0671737430\", \"0800792068\", \"0800794389\", \"0849919649\", \"0785289518\", \"141587011X\", \"0802443818\", \"1589975510\", \"0892656344\", \"1561790710\", \"1591454875\", \"0736939989\", \"0892830913\", \"0768425921\", \"0849940869\", \"0310217431\", \"0310287669\", \"0802423264\", \"0310402913\", \"1581349513\", \"1589971434\", \"0830744916\", \"1615216340\", \"0785289232\", \"0830725350\", \"0884196577\", \"0830755683\", \"1845505522\"];\\n    product_node_feature = [\"0800792068\".category=\"Books\", \"0800794389\".category=\"Books\", \"0849919649\".category=\"Books\", \"0785289518\".category=\"Books\", \"141587011X\".category=\"Books\", \"0802443818\".category=\"Books\", \"1589975510\".category=\"Books\", \"0892656344\".category=\"Books\", \"1561790710\".category=\"Books\", \"1591454875\".category=\"Books\", \"0736939989\".category=\"Books\", \"0892830913\".category=\"Books\", \"0768425921\".category=\"Books\", \"0849940869\".category=\"Books\", \"0310217431\".category=\"Books\", \"0310287669\".category=\"Books\", \"0802423264\".category=\"Books\", \"0310402913\".category=\"Books\", \"1581349513\".category=\"Books\", \"1589971434\".category=\"Books\", \"0830744916\".category=\"Books\", \"1615216340\".category=\"Books\", \"0785289232\".category=\"Books\", \"0830725350\".category=\"Books\", \"0884196577\".category=\"Books\", \"0830755683\".category=\"Books\", \"1845505522\".category=\"Books\"];\\n    product_triple_list = [(\"0800792068\" -> \"0800794389\"), (\"0849919649\" -> \"0785289518\"), (\"141587011X\" -> \"0802443818\"), (\"1589975510\" -> \"0892656344\"), (\"1561790710\" -> \"1591454875\"), (\"141587011X\" -> \"0736939989\"), (\"0800792068\" -> \"0892830913\"), (\"0800792068\" -> \"0768425921\"), (\"0671737430\" -> \"1589975510\"), (\"1561790710\" -> \"0849940869\"), (\"1561790710\" -> \"0310217431\"), (\"141587011X\" -> \"0310287669\"), (\"141587011X\" -> \"0802423264\"), (\"0671737430\" -> \"1561790710\"), (\"1561790710\" -> \"0310402913\"), (\"141587011X\" -> \"1581349513\"), (\"1589975510\" -> \"1589971434\"), (\"0671737430\" -> \"0849919649\"), (\"0671737430\" -> \"0800792068\"), (\"1589975510\" -> \"0830744916\"), (\"0849919649\" -> \"1615216340\"), (\"1561790710\" -> \"0785289232\"), (\"0671737430\" -> \"141587011X\"), (\"0800792068\" -> \"0830725350\"), (\"0800792068\" -> \"0884196577\"), (\"1589975510\" -> \"0830755683\"), (\"1589975510\" -> \"1845505522\")];\\n    target_product_node = \"0671737430\";\\n}\\n```\\nTask definition: given a product and corresponding graph, classify the target product into one of Arts,.Crafts.&.Sewing, Buy.a.Kindle, Car.Electronics, Patio,.Lawn.&.Garden, Luxury.Beauty, Collectibles.&.Fine.Art, #508510, Beauty, Health.&.Personal.Care, Books.\\nQ: Please classify the target product. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"product-graph\"] {\\n    product_node_list = [\"0671737430\", \"0800792068\", \"0800794389\", \"0849919649\", \"0785289518\", \"141587011X\", \"0802443818\", \"1589975510\", \"0892656344\", \"1561790710\", \"1591454875\", \"0736939989\", \"0892830913\", \"0768425921\", \"0849940869\", \"0310217431\", \"0310287669\", \"0802423264\", \"0310402913\", \"1581349513\", \"1589971434\", \"0830744916\", \"1615216340\", \"0785289232\", \"0830725350\", \"0884196577\", \"0830755683\", \"1845505522\"];\\n    product_node_feature = [\"0800792068\".category=\"Books\", \"0800794389\".category=\"Books\", \"0849919649\".category=\"Books\", \"0785289518\".category=\"Books\", \"141587011X\".category=\"Books\", \"0802443818\".category=\"Books\", \"1589975510\".category=\"Books\", \"0892656344\".category=\"Books\", \"1561790710\".category=\"Books\", \"1591454875\".category=\"Books\", \"0736939989\".category=\"Books\", \"0892830913\".category=\"Books\", \"0768425921\".category=\"Books\", \"0849940869\".category=\"Books\", \"0310217431\".category=\"Books\", \"0310287669\".category=\"Books\", \"0802423264\".category=\"Books\", \"0310402913\".category=\"Books\", \"1581349513\".category=\"Books\", \"1589971434\".category=\"Books\", \"0830744916\".category=\"Books\", \"1615216340\".category=\"Books\", \"0785289232\".category=\"Books\", \"0830725350\".category=\"Books\", \"0884196577\".category=\"Books\", \"0830755683\".category=\"Books\", \"1845505522\".category=\"Books\"];\\n    product_triple_list = [(\"0800792068\" -> \"0800794389\"), (\"0849919649\" -> \"0785289518\"), (\"141587011X\" -> \"0802443818\"), (\"1589975510\" -> \"0892656344\"), (\"1561790710\" -> \"1591454875\"), (\"141587011X\" -> \"0736939989\"), (\"0800792068\" -> \"0892830913\"), (\"0800792068\" -> \"0768425921\"), (\"0671737430\" -> \"1589975510\"), (\"1561790710\" -> \"0849940869\"), (\"1561790710\" -> \"0310217431\"), (\"141587011X\" -> \"0310287669\"), (\"141587011X\" -> \"0802423264\"), (\"0671737430\" -> \"1561790710\"), (\"1561790710\" -> \"0310402913\"), (\"141587011X\" -> \"1581349513\"), (\"1589975510\" -> \"1589971434\"), (\"0671737430\" -> \"0849919649\"), (\"0671737430\" -> \"0800792068\"), (\"1589975510\" -> \"0830744916\"), (\"0849919649\" -> \"1615216340\"), (\"1561790710\" -> \"0785289232\"), (\"0671737430\" -> \"141587011X\"), (\"0800792068\" -> \"0830725350\"), (\"0800792068\" -> \"0884196577\"), (\"1589975510\" -> \"0830755683\"), (\"1589975510\" -> \"1845505522\")];\\n    target_product_node = \"0671737430\";\\n}\\n```', 'graph': {'node_list': ['0671737430', '0800792068', '0800794389', '0849919649', '0785289518', '141587011X', '0802443818', '1589975510', '0892656344', '1561790710', '1591454875', '0736939989', '0892830913', '0768425921', '0849940869', '0310217431', '0310287669', '0802423264', '0310402913', '1581349513', '1589971434', '0830744916', '1615216340', '0785289232', '0830725350', '0884196577', '0830755683', '1845505522'], 'edge_list': [('0800792068', '0800794389'), ('0849919649', '0785289518'), ('141587011X', '0802443818'), ('1589975510', '0892656344'), ('1561790710', '1591454875'), ('141587011X', '0736939989'), ('0800792068', '0892830913'), ('0800792068', '0768425921'), ('0671737430', '1589975510'), ('1561790710', '0849940869'), ('1561790710', '0310217431'), ('141587011X', '0310287669'), ('141587011X', '0802423264'), ('0671737430', '1561790710'), ('1561790710', '0310402913'), ('141587011X', '1581349513'), ('1589975510', '1589971434'), ('0671737430', '0849919649'), ('0671737430', '0800792068'), ('1589975510', '0830744916'), ('0849919649', '1615216340'), ('1561790710', '0785289232'), ('0671737430', '141587011X'), ('0800792068', '0830725350'), ('0800792068', '0884196577'), ('1589975510', '0830755683'), ('1589975510', '1845505522')], 'node_feature': {'0800792068': {'label': 'Books'}, '0800794389': {'label': 'Books'}, '0849919649': {'label': 'Books'}, '0785289518': {'label': 'Books'}, '141587011X': {'label': 'Books'}, '0802443818': {'label': 'Books'}, '1589975510': {'label': 'Books'}, '0892656344': {'label': 'Books'}, '1561790710': {'label': 'Books'}, '1591454875': {'label': 'Books'}, '0736939989': {'label': 'Books'}, '0892830913': {'label': 'Books'}, '0768425921': {'label': 'Books'}, '0849940869': {'label': 'Books'}, '0310217431': {'label': 'Books'}, '0310287669': {'label': 'Books'}, '0802423264': {'label': 'Books'}, '0310402913': {'label': 'Books'}, '1581349513': {'label': 'Books'}, '1589971434': {'label': 'Books'}, '0830744916': {'label': 'Books'}, '1615216340': {'label': 'Books'}, '0785289232': {'label': 'Books'}, '0830725350': {'label': 'Books'}, '0884196577': {'label': 'Books'}, '0830755683': {'label': 'Books'}, '1845505522': {'label': 'Books'}}}, 'answer': ['Books'], 'answer_with_cot': ['To classify the target product, we need to analyze the given graph and the node information.\\n\\n1. First, let\\'s look at the \"product_node_feature\" list. It contains information about the category of each product node. The target product node is \"0671737430\". This node does not have a specific category mentioned in the list.\\n\\n2. Next, let\\'s examine the \"product_triple_list\". It represents connections between product nodes. We can trace the connections from the target product node and see if any connected nodes have a category mentioned in the \"product_node_feature\" list.\\n\\nStarting from \"0671737430\", we can follow the connections:\\n- \"0671737430\" -> \"1589975510\" -> \"0892656344\" (Books)\\n- \"0671737430\" -> \"0849919649\" (Books)\\n- \"0671737430\" -> \"0800792068\" (Books)\\n- \"0671737430\" -> \"141587011X\" -> \"0802443818\" (Books)\\n- \"0671737430\" -> \"141587011X\" -> \"0736939989\" (Books)\\n- \"0671737430\" -> \"1561790710\" -> \"1591454875\" (Books)\\n- \"0671737430\" -> \"1561790710\" -> \"0849940869\" (Books)\\n- \"0671737430\" -> \"1561790710\" -> \"0310217431\" (Books)\\n- \"0671737430\" -> \"1561790710\" -> \"0310402913\" (Books)\\n- \"0671737430\" -> \"141587011X\" -> \"1581349513\" (Books)\\n- \"0671737430\" -> \"1589975510\" -> \"1589971434\" (Books)\\n- \"0671737430\" -> \"0800792068\" -> \"0892830913\" (Books)\\n- \"0671737430\" -> \"0800792068\" -> \"0768425921\" (Books)\\n- \"0671737430\" -> \"0800792068\" -> \"0830725350\" (Books)\\n- \"0671737430\" -> \"0800792068\" -> \"0884196577\" (Books)\\n- \"0671737430\" -> \"1589975510\" -> \"0830755683\" (Books)\\n- \"0671737430\" -> \"1589975510\" -> \"1845505522\" (Books)\\n\\nFrom the above connections, we can see that all connected nodes have a category of \"Books\" mentioned in the \"product_node_feature\" list.\\n\\nBased on this analysis, we can classify the target product \"0671737430\" as a book.'], 'difficulty': 'easy', 'from': 'OGBN-Products'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-wikidata5m', 'idx': 11397, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'uzal\\', \\'sheleph\\', \\'Hadoram\\', \\'elmodad\\', \\'Huamn\\', \\'Obal\\', \\'Hazarmaveth\\'];\\n    triple_list = [(\"Hazarmaveth\" -> \"Hadoram\")[relation=\"sibling\"], (\"Hazarmaveth\" -> \"uzal\")[relation=\"sibling\"], (\"Hazarmaveth\" -> \"sheleph\")[relation=\"sibling\"], (\"Hazarmaveth\" -> \"Huamn\")[relation=\"instance of\"], (\"Hazarmaveth\" -> \"Obal\")[relation=\"father\"], (\"elmodad\" -> \"uzal\")[relation=\"sibling\"], (\"elmodad\" -> \"sheleph\")[relation=\"sibling\"], (\"elmodad\" -> \"Hadoram\")[relation=\"sibling\"], (\"elmodad\" -> \"Huamn\")[relation=\"instance of\"], (\"elmodad\" -> \"Obal\")[relation=\"father\"]];;\\n    head_entity = \"elmodad\";\\n    tail_entity = \"Obal\";\\n}\\n```\\nTask definition: given one head entity and tail entity and corresponding one-hop knowledge sub-graph, classify the relation between head entity and tail entity into one of \"owned by\", \"award received\", \"neurological function\", \"recording or performance of\", \"father\", \"instance of\", \"direction\", \"co-driver\", \"sibling\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'uzal\\', \\'sheleph\\', \\'Hadoram\\', \\'elmodad\\', \\'Huamn\\', \\'Obal\\', \\'Hazarmaveth\\'];\\n    triple_list = [(\"Hazarmaveth\" -> \"Hadoram\")[relation=\"sibling\"], (\"Hazarmaveth\" -> \"uzal\")[relation=\"sibling\"], (\"Hazarmaveth\" -> \"sheleph\")[relation=\"sibling\"], (\"Hazarmaveth\" -> \"Huamn\")[relation=\"instance of\"], (\"Hazarmaveth\" -> \"Obal\")[relation=\"father\"], (\"elmodad\" -> \"uzal\")[relation=\"sibling\"], (\"elmodad\" -> \"sheleph\")[relation=\"sibling\"], (\"elmodad\" -> \"Hadoram\")[relation=\"sibling\"], (\"elmodad\" -> \"Huamn\")[relation=\"instance of\"], (\"elmodad\" -> \"Obal\")[relation=\"father\"]];;\\n    head_entity = \"elmodad\";\\n    tail_entity = \"Obal\";\\n}\\n```', 'graph': {'node_list': ['uzal', 'sheleph', 'Hadoram', 'elmodad', 'Huamn', 'Obal', 'Hazarmaveth'], 'edge_list': [('Hazarmaveth', 'sibling', 'Hadoram'), ('Hazarmaveth', 'sibling', 'uzal'), ('Hazarmaveth', 'sibling', 'sheleph'), ('Hazarmaveth', 'instance of', 'Huamn'), ('Hazarmaveth', 'father', 'Obal'), ('elmodad', 'sibling', 'uzal'), ('elmodad', 'sibling', 'sheleph'), ('elmodad', 'sibling', 'Hadoram'), ('elmodad', 'instance of', 'Huamn'), ('elmodad', 'father', 'Obal')]}, 'answer': ['sibling'], 'answer_with_cot': ['To classify the relation between the head entity \"elmodad\" and the tail entity \"Obal\", we need to examine the provided graph and the information it contains.\\n\\nLooking at the graph, we can observe the following relationships:\\n\\n1. (elmodad -> Obal) with the relation \"father\".\\n2. (elmodad -> Huamn) with the relation \"instance of\".\\n3. (Hazarmaveth -> Obal) with the relation \"father\".\\n4. (Hazarmaveth -> Hadoram) with the relation \"sibling\".\\n5. (Hazarmaveth -> sheleph) with the relation \"sibling\".\\n6. (Hazarmaveth -> uzal) with the relation \"sibling\".\\n7. (Hazarmaveth -> Huamn) with the relation \"instance of\".\\n\\nConsidering these relationships, the closest relationship between \"elmodad\" and \"Obal\" is \"father\". Thus, we can classify the relation between the head entity and the tail entity as \"father\".'], 'difficulty': 'medium', 'from': 'Wikidata5M'},\n",
       "       {'task_name': 'graph-language-modeling-graph-relevance-inspection', 'idx': 10154, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikipedia-knowledge-graph\"] {\\n    entity_list = [\\'community\\', \\'comfort\\', \\'united states\\', \\'weston, dunn county, wisconsin\\', \\'unincorporated community\\', \\'located\\', \\'the town\\'];\\n    triple_list = [(\"community\" -> \"located\")[relation=\"subclass of\"], (\"weston, dunn county, wisconsin\" -> \"united states\")[relation=\"country\"]];\\n}\\n```\\nCaption: Comfort is an unincorporated community located in the town of Weston, Dunn County, Wisconsin, United States. The community was named for Comfort Starr.\\nTask definition: A binary classification task to inspect whether the given caption is relevant to the graph. The classes are \"Relevant\" and \"Irrelevant\". Note that: Irrelevance means that all the information mentioned in the caption cannot be found in the graph.\\nQ: Given you a knowledge graph and a caption, please inspect whether the caption is relevant to the graph. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikipedia-knowledge-graph\"] {\\n    entity_list = [\\'community\\', \\'comfort\\', \\'united states\\', \\'weston, dunn county, wisconsin\\', \\'unincorporated community\\', \\'located\\', \\'the town\\'];\\n    triple_list = [(\"community\" -> \"located\")[relation=\"subclass of\"], (\"weston, dunn county, wisconsin\" -> \"united states\")[relation=\"country\"]];\\n}\\n```', 'graph': {'node_list': ['community', 'comfort', 'united states', 'weston, dunn county, wisconsin', 'unincorporated community', 'located', 'the town'], 'edge_list': [['community', 'subclass of', 'located'], ['weston, dunn county, wisconsin', 'country', 'united states']]}, 'answer': ['Relevant'], 'answer_with_cot': ['To determine the relevance of the caption to the graph, we need to check if all the information mentioned in the caption can be found in the graph.\\n\\nLet\\'s break down the caption and compare it with the information in the graph:\\n\\nCaption: Comfort is an unincorporated community located in the town of Weston, Dunn County, Wisconsin, United States.\\n\\n1. Comfort: We can see that \"community\" is mentioned in the graph\\'s entity_list, but \"Comfort\" specifically is not mentioned. However, we can infer that \"Comfort\" is represented by the entity \"community\" in the graph.\\n\\n2. Unincorporated community: The graph\\'s entity_list includes \"unincorporated community\", which matches the mentioned term.\\n\\n3. Located: The graph\\'s entity_list includes \"located\" as a node. This matches the mentioned term as well.\\n\\n4. The town of Weston, Dunn County, Wisconsin, United States: The graph contains a triple that states (\"weston, dunn county, wisconsin\" -> \"united states\")[relation=\"country\"]. Therefore, the information about Weston, Dunn County, Wisconsin, and United States is present in the graph.\\n\\nBased on this analysis, we can conclude that all the information mentioned in the caption can be found in the graph. Therefore, the caption is relevant to the graph.\\n\\nFinal answer: Relevant'], 'difficulty': 'simple', 'from': 'GraphCaptionGeneration'},\n",
       "       {'task_name': 'graph-structure-modeling-graph-connectivity-detection-nlgraph', 'idx': 1675, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"connectivity-detection\"] {\\n    node_list = [0, 1, 2, 3, 4, 6, 7, 8, 9, 13, 14, 16, 17, 19, 20, 21, 22, 23, 24, 27, 28, 29, 30, 31, 32];\\n    edge_list = [(0 <-> 19), (0 <-> 21), (0 <-> 17), (0 <-> 7), (0 <-> 29), (1 <-> 20), (2 <-> 32), (2 <-> 6), (2 <-> 13), (3 <-> 22), (3 <-> 23), (3 <-> 8), (4 <-> 30), (4 <-> 31), (6 <-> 23), (6 <-> 16), (6 <-> 32), (7 <-> 19), (8 <-> 14), (8 <-> 23), (8 <-> 16), (8 <-> 32), (8 <-> 13), (9 <-> 24), (9 <-> 17), (9 <-> 29), (13 <-> 14), (13 <-> 32), (14 <-> 16), (14 <-> 32), (16 <-> 20), (16 <-> 28), (17 <-> 24), (20 <-> 28), (21 <-> 29), (24 <-> 29), (27 <-> 30), (30 <-> 31)];\\n}\\n```\\nTask definition: determine if there is a path between two nodes in the graph.\\nQ: Is there a path between node 17 and node 12? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"connectivity-detection\"] {\\n    node_list = [0, 1, 2, 3, 4, 6, 7, 8, 9, 13, 14, 16, 17, 19, 20, 21, 22, 23, 24, 27, 28, 29, 30, 31, 32];\\n    edge_list = [(0 <-> 19), (0 <-> 21), (0 <-> 17), (0 <-> 7), (0 <-> 29), (1 <-> 20), (2 <-> 32), (2 <-> 6), (2 <-> 13), (3 <-> 22), (3 <-> 23), (3 <-> 8), (4 <-> 30), (4 <-> 31), (6 <-> 23), (6 <-> 16), (6 <-> 32), (7 <-> 19), (8 <-> 14), (8 <-> 23), (8 <-> 16), (8 <-> 32), (8 <-> 13), (9 <-> 24), (9 <-> 17), (9 <-> 29), (13 <-> 14), (13 <-> 32), (14 <-> 16), (14 <-> 32), (16 <-> 20), (16 <-> 28), (17 <-> 24), (20 <-> 28), (21 <-> 29), (24 <-> 29), (27 <-> 30), (30 <-> 31)];\\n}\\n```', 'graph': {'node_list': [0, 1, 2, 3, 4, 6, 7, 8, 9, 13, 14, 16, 17, 19, 20, 21, 22, 23, 24, 27, 28, 29, 30, 31, 32], 'edge_list': [('0', '19'), ('0', '21'), ('0', '17'), ('0', '7'), ('0', '29'), ('1', '20'), ('2', '32'), ('2', '6'), ('2', '13'), ('3', '22'), ('3', '23'), ('3', '8'), ('4', '30'), ('4', '31'), ('6', '23'), ('6', '16'), ('6', '32'), ('7', '19'), ('8', '14'), ('8', '23'), ('8', '16'), ('8', '32'), ('8', '13'), ('9', '24'), ('9', '17'), ('9', '29'), ('13', '14'), ('13', '32'), ('14', '16'), ('14', '32'), ('16', '20'), ('16', '28'), ('17', '24'), ('20', '28'), ('21', '29'), ('24', '29'), ('27', '30'), ('30', '31')]}, 'answer': ['The answer is no.'], 'answer_with_cot': ['To determine if there is a path between node 17 and node 12, we need to examine the connections between the nodes in the graph. However, node 12 is not present in the given graph. Therefore, there is no path between node 17 and node 12 in this particular graph.'], 'difficulty': 'hard', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-wikidata5m', 'idx': 24868, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'owd bob (1924 film)\\', \\'black-and-white cinema\\', \\'drama movie\\', \\'colourful\\', \\'Number of words in English\\', \\'royaume-uni\\', \\'color film (motion picture)\\', \\'movie\\'];\\n    triple_list = [(\"owd bob (1924 film)\" -> \"Number of words in English\")[relation=\"original language of film or TV show\"], (\"owd bob (1924 film)\" -> \"royaume-uni\")[relation=\"country of origin\"], (\"owd bob (1924 film)\" -> \"movie\")[relation=\"instance of\"], (\"owd bob (1924 film)\" -> \"drama movie\")[relation=\"genre\"], (\"black-and-white cinema\" -> \"color film (motion picture)\")[relation=\"followed by\"], (\"black-and-white cinema\" -> \"colourful\")[relation=\"instance of\"]];;\\n    head_entity = \"black-and-white cinema\";\\n    tail_entity = \"colourful\";\\n}\\n```\\nTask definition: given one head entity and tail entity and corresponding one-hop knowledge sub-graph, classify the relation between head entity and tail entity into one of \"subsidiary\", \"commissioned by\", \"taxonomic type\", \"country of origin\", \"color\", \"instance of\", \"followed by\", \"genre\", \"muscle origin\", \"had as last meal\", \"original language of film or TV show\", \"gene inversion association with\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'owd bob (1924 film)\\', \\'black-and-white cinema\\', \\'drama movie\\', \\'colourful\\', \\'Number of words in English\\', \\'royaume-uni\\', \\'color film (motion picture)\\', \\'movie\\'];\\n    triple_list = [(\"owd bob (1924 film)\" -> \"Number of words in English\")[relation=\"original language of film or TV show\"], (\"owd bob (1924 film)\" -> \"royaume-uni\")[relation=\"country of origin\"], (\"owd bob (1924 film)\" -> \"movie\")[relation=\"instance of\"], (\"owd bob (1924 film)\" -> \"drama movie\")[relation=\"genre\"], (\"black-and-white cinema\" -> \"color film (motion picture)\")[relation=\"followed by\"], (\"black-and-white cinema\" -> \"colourful\")[relation=\"instance of\"]];;\\n    head_entity = \"black-and-white cinema\";\\n    tail_entity = \"colourful\";\\n}\\n```', 'graph': {'node_list': ['owd bob (1924 film)', 'black-and-white cinema', 'drama movie', 'colourful', 'Number of words in English', 'royaume-uni', 'color film (motion picture)', 'movie'], 'edge_list': [('owd bob (1924 film)', 'original language of film or TV show', 'Number of words in English'), ('owd bob (1924 film)', 'country of origin', 'royaume-uni'), ('owd bob (1924 film)', 'instance of', 'movie'), ('owd bob (1924 film)', 'genre', 'drama movie'), ('black-and-white cinema', 'followed by', 'color film (motion picture)'), ('black-and-white cinema', 'instance of', 'colourful')]}, 'answer': ['color'], 'answer_with_cot': ['To classify the relation between the head entity \"black-and-white cinema\" and the tail entity \"colourful\", we need to analyze the given sub-graph:\\n\\n1. Check the triple_list for a direct connection between the head and tail entities. \\n   - In this case, there is a connection between \"black-and-white cinema\" and \"colourful\" with the relation \"instance of\". \\n\\nThe relation between the head entity \"black-and-white cinema\" and the tail entity \"colourful\" can be classified as \"instance of\".'], 'difficulty': 'medium', 'from': 'Wikidata5M'},\n",
       "       {'task_name': 'graph-language-modeling-graph-node-cls-citeseer', 'idx': 561, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"citeseer-scientific-publications-citation-graph\"] {\\n    publication_node_list = [\"paper_194\", \"paper_355\", \"paper_516\", \"paper_356\", \"paper_69\", \"paper_357\", \"paper_265\", \"paper_107\", \"paper_1007\", \"paper_655\", \"paper_1650\", \"paper_755\", \"paper_501\", \"paper_502\", \"paper_567\", \"paper_888\", \"paper_508\"];\\n    publication_node_feature = [\"paper_194\".category=\"IR\", \"paper_355\".category=\"IR\", \"paper_516\".category=\"IR\", \"paper_356\".category=\"IR\", \"paper_69\".category=\"IR\", \"paper_357\".category=\"IR\", \"paper_107\".category=\"IR\", \"paper_1007\".category=\"IR\", \"paper_655\".category=\"IR\", \"paper_1650\".category=\"IR\", \"paper_755\".category=\"IR\", \"paper_501\".category=\"IR\", \"paper_502\".category=\"IR\", \"paper_567\".category=\"ML\", \"paper_888\".category=\"IR\", \"paper_508\".category=\"IR\"];\\n    target_publication_node = \"paper_265\";\\n    citation_triple_list = [(\"paper_69\" -> \"paper_355\"), (\"paper_501\" -> \"paper_1007\"), (\"paper_655\" -> \"paper_1007\"), (\"paper_502\" -> \"paper_508\"), (\"paper_502\" -> \"paper_755\"), (\"paper_265\" -> \"paper_501\"), (\"paper_69\" -> \"paper_516\"), (\"paper_567\" -> \"paper_1650\"), (\"paper_265\" -> \"paper_888\"), (\"paper_265\" -> \"paper_107\"), (\"paper_888\" -> \"paper_357\"), (\"paper_502\" -> \"paper_501\"), (\"paper_265\" -> \"paper_567\"), (\"paper_502\" -> \"paper_107\"), (\"paper_502\" -> \"paper_1007\"), (\"paper_655\" -> \"paper_508\"), (\"paper_265\" -> \"paper_655\"), (\"paper_69\" -> \"paper_356\"), (\"paper_265\" -> \"paper_69\"), (\"paper_265\" -> \"paper_194\"), (\"paper_265\" -> \"paper_502\")];\\n}\\n```\\nTask definition: given a target scientific publication and corresponding citation graph, classify the target scientific publication into one of six categories, such as \\'AI\\', \\'Agents\\', \\'DB\\', \\'HCI\\', \\'IR\\', and \\'ML\\'.\\nQ: Please classify the target scientific publication. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"citeseer-scientific-publications-citation-graph\"] {\\n    publication_node_list = [\"paper_194\", \"paper_355\", \"paper_516\", \"paper_356\", \"paper_69\", \"paper_357\", \"paper_265\", \"paper_107\", \"paper_1007\", \"paper_655\", \"paper_1650\", \"paper_755\", \"paper_501\", \"paper_502\", \"paper_567\", \"paper_888\", \"paper_508\"];\\n    publication_node_feature = [\"paper_194\".category=\"IR\", \"paper_355\".category=\"IR\", \"paper_516\".category=\"IR\", \"paper_356\".category=\"IR\", \"paper_69\".category=\"IR\", \"paper_357\".category=\"IR\", \"paper_107\".category=\"IR\", \"paper_1007\".category=\"IR\", \"paper_655\".category=\"IR\", \"paper_1650\".category=\"IR\", \"paper_755\".category=\"IR\", \"paper_501\".category=\"IR\", \"paper_502\".category=\"IR\", \"paper_567\".category=\"ML\", \"paper_888\".category=\"IR\", \"paper_508\".category=\"IR\"];\\n    target_publication_node = \"paper_265\";\\n    citation_triple_list = [(\"paper_69\" -> \"paper_355\"), (\"paper_501\" -> \"paper_1007\"), (\"paper_655\" -> \"paper_1007\"), (\"paper_502\" -> \"paper_508\"), (\"paper_502\" -> \"paper_755\"), (\"paper_265\" -> \"paper_501\"), (\"paper_69\" -> \"paper_516\"), (\"paper_567\" -> \"paper_1650\"), (\"paper_265\" -> \"paper_888\"), (\"paper_265\" -> \"paper_107\"), (\"paper_888\" -> \"paper_357\"), (\"paper_502\" -> \"paper_501\"), (\"paper_265\" -> \"paper_567\"), (\"paper_502\" -> \"paper_107\"), (\"paper_502\" -> \"paper_1007\"), (\"paper_655\" -> \"paper_508\"), (\"paper_265\" -> \"paper_655\"), (\"paper_69\" -> \"paper_356\"), (\"paper_265\" -> \"paper_69\"), (\"paper_265\" -> \"paper_194\"), (\"paper_265\" -> \"paper_502\")];\\n}\\n```', 'graph': {'node_list': {194, 355, 516, 356, 69, 357, 265, 107, 1007, 655, 1650, 755, 501, 502, 567, 888, 508}, 'edge_list': {(69, 355), (501, 1007), (655, 1007), (502, 755), (502, 508), (265, 501), (69, 516), (567, 1650), (265, 888), (265, 107), (888, 357), (502, 501), (265, 567), (502, 107), (502, 1007), (655, 508), (265, 655), (69, 356), (265, 69), (265, 194), (265, 502)}, 'node_feature': {194: 'IR', 355: 'IR', 516: 'IR', 356: 'IR', 69: 'IR', 357: 'IR', 107: 'IR', 1007: 'IR', 655: 'IR', 1650: 'IR', 755: 'IR', 501: 'IR', 502: 'IR', 567: 'ML', 888: 'IR', 508: 'IR'}}, 'answer': ['IR'], 'answer_with_cot': ['To classify the target scientific publication, we need to analyze the citation graph and its node information. In this case, the citation graph is defined as follows:\\n\\n- The publication node list contains a list of nodes representing scientific publications, such as \"paper_194\", \"paper_355\", etc.\\n- The publication node feature contains the category information for each publication node. For example, \"paper_194\" belongs to the category \"IR\", \"paper_355\" also belongs to the category \"IR\", etc.\\n- The target publication node is \"paper_265\".\\n- The citation triple list represents the connections between different publication nodes. For example, (i -> j) means node i cites node j.\\n\\nTo classify the target scientific publication, we can start by examining its direct connections (incoming and outgoing) in the citation graph. We can also consider the categories of the connected nodes and their connections with other nodes.\\n\\nBy analyzing the citation triple list, we can determine the direct connections of the target publication node \"paper_265\" as follows:\\n- \"paper_69\" -> \"paper_265\"\\n- \"paper_501\" -> \"paper_265\"\\n- \"paper_567\" -> \"paper_265\"\\n- \"paper_888\" -> \"paper_265\"\\n- \"paper_107\" -> \"paper_265\"\\n- \"paper_655\" -> \"paper_265\"\\n\\nBased on the categories of these connected nodes, we can see that \"paper_69\", \"paper_501\", \"paper_567\", \"paper_888\", \"paper_107\", and \"paper_655\" all belong to the category \"IR\". Therefore, we can assume that the target publication \"paper_265\" is also likely to belong to the category \"IR\".\\n\\nTo further refine the classification, we can analyze the connections of the connected nodes to get more insights. For example, we can look at the connections of \"paper_69\", \"paper_501\", \"paper_567\", \"paper_888\", \"paper_107\", and \"paper_655\". By examining their connections and categories, we may be able to identify any patterns or dominant categories.\\n\\nIn conclusion, based on the given information and analysis, we can classify the target scientific publication \"paper_265\" into the category \"IR\".'], 'difficulty': 'easy', 'from': 'CiteSeer'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-wikidata5m', 'idx': 7783, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'Taxxon\\', \\'ptilinopus coralensis\\', \\'French Pacific\\', \\'Chrysoenas\\', \\'concept\\', \\'Books/Organism\\', \\'Near Threatened\\', \\'cohesion species\\', \\'cladex/testcases\\'];\\n    triple_list = [(\"ptilinopus coralensis\" -> \"Chrysoenas\")[relation=\"parent taxon\"], (\"ptilinopus coralensis\" -> \"French Pacific\")[relation=\"endemic to\"], (\"ptilinopus coralensis\" -> \"cohesion species\")[relation=\"taxon rank\"], (\"ptilinopus coralensis\" -> \"Near Threatened\")[relation=\"IUCN conservation status\"], (\"Taxxon\" -> \"concept\")[relation=\"subclass of\"], (\"Taxxon\" -> \"Books/Organism\")[relation=\"has part\"], (\"Taxxon\" -> \"cladex/testcases\")[relation=\"different from\"]];;\\n    head_entity = \"Taxxon\";\\n    tail_entity = \"cladex/testcases\";\\n}\\n```\\nTask definition: given one head entity and tail entity and corresponding one-hop knowledge sub-graph, classify the relation between head entity and tail entity into one of \"family\", \"endemic to\", \"socket supported\", \"taxon rank\", \"replaces\", \"subclass of\", \"has part\", \"emulates\", \"instance of\", \"parent taxon\", \"different from\", \"IUCN conservation status\", \"has effect\", \"phase of matter\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'Taxxon\\', \\'ptilinopus coralensis\\', \\'French Pacific\\', \\'Chrysoenas\\', \\'concept\\', \\'Books/Organism\\', \\'Near Threatened\\', \\'cohesion species\\', \\'cladex/testcases\\'];\\n    triple_list = [(\"ptilinopus coralensis\" -> \"Chrysoenas\")[relation=\"parent taxon\"], (\"ptilinopus coralensis\" -> \"French Pacific\")[relation=\"endemic to\"], (\"ptilinopus coralensis\" -> \"cohesion species\")[relation=\"taxon rank\"], (\"ptilinopus coralensis\" -> \"Near Threatened\")[relation=\"IUCN conservation status\"], (\"Taxxon\" -> \"concept\")[relation=\"subclass of\"], (\"Taxxon\" -> \"Books/Organism\")[relation=\"has part\"], (\"Taxxon\" -> \"cladex/testcases\")[relation=\"different from\"]];;\\n    head_entity = \"Taxxon\";\\n    tail_entity = \"cladex/testcases\";\\n}\\n```', 'graph': {'node_list': ['Taxxon', 'ptilinopus coralensis', 'French Pacific', 'Chrysoenas', 'concept', 'Books/Organism', 'Near Threatened', 'cohesion species', 'cladex/testcases'], 'edge_list': [('ptilinopus coralensis', 'parent taxon', 'Chrysoenas'), ('ptilinopus coralensis', 'endemic to', 'French Pacific'), ('ptilinopus coralensis', 'taxon rank', 'cohesion species'), ('ptilinopus coralensis', 'IUCN conservation status', 'Near Threatened'), ('Taxxon', 'subclass of', 'concept'), ('Taxxon', 'has part', 'Books/Organism'), ('Taxxon', 'different from', 'cladex/testcases')]}, 'answer': ['instance of'], 'answer_with_cot': ['To classify the relation between the head entity \"Taxxon\" and the tail entity \"cladex/testcases\", we need to first examine the provided one-hop knowledge sub-graph. \\nFrom the triple_list in the graph, we can see that there is a directed edge between \"Taxxon\" and \"cladex/testcases\" with the relation \"different from\". Therefore, the relation between the head entity and the tail entity is \"different from\".'], 'difficulty': 'medium', 'from': 'Wikidata5M'},\n",
       "       {'task_name': 'graph-language-modeling-graph-question-answering-webquestions', 'idx': 5205, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'Dartmouth\\', \\'Comfort Cove\\', \\'Black Bridge\\', \\'Nanisivik Mine\\', \\'Buscombe Lake\\', \\'Henry Williams\\', \\'Meritus University\\', \\'Newfoundland Time Zone\\', \\'Schwatka Lake\\', \\'Alice Priestley\\', \\'Mike Kusiewicz\\', \\'New Perlican\\', \\'James Henry Gundy\\', \\'David John Russell\\', \\'Équipe Autonomiste\\', \\'Canada\\', \\'Forest Lawn\\', \"Archie Campbell\\'s Cove\", \\'Canadian Radio-television and Telecommunications Commission\\', \\'Garrison Creek\\', \\'Manon Charette\\', \\'Ronit Avni\\', \\'Bragg Creek Provincial Park\\', \\'Open Secrets\\', \\'Ravi Sood\\', \\'Wards Brook\\', \\'NorQuest College\\', \"The Pan-American Dream: Do Latin America\\'s Cultural Values Discourage True Partnership with the United States and Canada?\"];\\n    triple_list = [(\"Canada\" -> \"David John Russell\")[relation=\"people born here\"], (\"Canada\" -> \"Henry Williams\")[relation=\"people born here\"], (\"Canada\" -> \"James Henry Gundy\")[relation=\"people born here\"], (\"Canada\" -> \"Alice Priestley\")[relation=\"people born here\"], (\"Canada\" -> \"Open Secrets\")[relation=\"works\"], (\"Canada\" -> \"Forest Lawn\")[relation=\"contains\"], (\"Canada\" -> \"Black Bridge\")[relation=\"featured in films\"], (\"Canada\" -> \"Canadian Radio-television and Telecommunications Commission\")[relation=\"agencies\"], (\"Canada\" -> \"NorQuest College\")[relation=\"contains\"], (\"Canada\" -> \"Dartmouth\")[relation=\"contains\"], (\"Canada\" -> \"Ronit Avni\")[relation=\"people born here\"], (\"Canada\" -> \"Schwatka Lake\")[relation=\"contains\"], (\"Canada\" -> \"Nanisivik Mine\")[relation=\"contains\"], (\"Canada\" -> \"Bragg Creek Provincial Park\")[relation=\"contains\"], (\"Canada\" -> \"Comfort Cove\")[relation=\"contains\"], (\"Canada\" -> \"Garrison Creek\")[relation=\"contains\"], (\"Newfoundland Time Zone\" -> \"Archie Campbell\\'s Cove\")[relation=\"locations in this time zone\"], (\"Canada\" -> \"Ravi Sood\")[relation=\"people born here\"], (\"Canada\" -> \"Meritus University\")[relation=\"contains\"], (\"Canada\" -> \"Mike Kusiewicz\")[relation=\"people born here\"], (\"Canada\" -> \"Wards Brook\")[relation=\"contains\"], (\"Canada\" -> \"Manon Charette\")[relation=\"people born here\"], (\"Canada\" -> \"Buscombe Lake\")[relation=\"contains\"], (\"Canada\" -> \"Équipe Autonomiste\")[relation=\"organizations with this scope\"], (\"Canada\" -> \"New Perlican\")[relation=\"contains\"], (\"Canada\" -> \"The Pan-American Dream: Do Latin America\\'s Cultural Values Discourage True Partnership with the United States and Canada?\")[relation=\"works\"]];\\n}\\n```\\nTask definition: given a question and a corresponding knowledge graph, and find an entity in the graph and answer the question.\\nQ: what country bordering the great lakes uses the local time zone called newfoundland time zone ? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'Dartmouth\\', \\'Comfort Cove\\', \\'Black Bridge\\', \\'Nanisivik Mine\\', \\'Buscombe Lake\\', \\'Henry Williams\\', \\'Meritus University\\', \\'Newfoundland Time Zone\\', \\'Schwatka Lake\\', \\'Alice Priestley\\', \\'Mike Kusiewicz\\', \\'New Perlican\\', \\'James Henry Gundy\\', \\'David John Russell\\', \\'Équipe Autonomiste\\', \\'Canada\\', \\'Forest Lawn\\', \"Archie Campbell\\'s Cove\", \\'Canadian Radio-television and Telecommunications Commission\\', \\'Garrison Creek\\', \\'Manon Charette\\', \\'Ronit Avni\\', \\'Bragg Creek Provincial Park\\', \\'Open Secrets\\', \\'Ravi Sood\\', \\'Wards Brook\\', \\'NorQuest College\\', \"The Pan-American Dream: Do Latin America\\'s Cultural Values Discourage True Partnership with the United States and Canada?\"];\\n    triple_list = [(\"Canada\" -> \"David John Russell\")[relation=\"people born here\"], (\"Canada\" -> \"Henry Williams\")[relation=\"people born here\"], (\"Canada\" -> \"James Henry Gundy\")[relation=\"people born here\"], (\"Canada\" -> \"Alice Priestley\")[relation=\"people born here\"], (\"Canada\" -> \"Open Secrets\")[relation=\"works\"], (\"Canada\" -> \"Forest Lawn\")[relation=\"contains\"], (\"Canada\" -> \"Black Bridge\")[relation=\"featured in films\"], (\"Canada\" -> \"Canadian Radio-television and Telecommunications Commission\")[relation=\"agencies\"], (\"Canada\" -> \"NorQuest College\")[relation=\"contains\"], (\"Canada\" -> \"Dartmouth\")[relation=\"contains\"], (\"Canada\" -> \"Ronit Avni\")[relation=\"people born here\"], (\"Canada\" -> \"Schwatka Lake\")[relation=\"contains\"], (\"Canada\" -> \"Nanisivik Mine\")[relation=\"contains\"], (\"Canada\" -> \"Bragg Creek Provincial Park\")[relation=\"contains\"], (\"Canada\" -> \"Comfort Cove\")[relation=\"contains\"], (\"Canada\" -> \"Garrison Creek\")[relation=\"contains\"], (\"Newfoundland Time Zone\" -> \"Archie Campbell\\'s Cove\")[relation=\"locations in this time zone\"], (\"Canada\" -> \"Ravi Sood\")[relation=\"people born here\"], (\"Canada\" -> \"Meritus University\")[relation=\"contains\"], (\"Canada\" -> \"Mike Kusiewicz\")[relation=\"people born here\"], (\"Canada\" -> \"Wards Brook\")[relation=\"contains\"], (\"Canada\" -> \"Manon Charette\")[relation=\"people born here\"], (\"Canada\" -> \"Buscombe Lake\")[relation=\"contains\"], (\"Canada\" -> \"Équipe Autonomiste\")[relation=\"organizations with this scope\"], (\"Canada\" -> \"New Perlican\")[relation=\"contains\"], (\"Canada\" -> \"The Pan-American Dream: Do Latin America\\'s Cultural Values Discourage True Partnership with the United States and Canada?\")[relation=\"works\"]];\\n}\\n```', 'graph': {'node_list': ['Dartmouth', 'Comfort Cove', 'Black Bridge', 'Nanisivik Mine', 'Buscombe Lake', 'Henry Williams', 'Meritus University', 'Newfoundland Time Zone', 'Schwatka Lake', 'Alice Priestley', 'Mike Kusiewicz', 'New Perlican', 'James Henry Gundy', 'David John Russell', 'Équipe Autonomiste', 'Canada', 'Forest Lawn', \"Archie Campbell's Cove\", 'Canadian Radio-television and Telecommunications Commission', 'Garrison Creek', 'Manon Charette', 'Ronit Avni', 'Bragg Creek Provincial Park', 'Open Secrets', 'Ravi Sood', 'Wards Brook', 'NorQuest College', \"The Pan-American Dream: Do Latin America's Cultural Values Discourage True Partnership with the United States and Canada?\"], 'edge_list': [('Canada', 'people born here', 'David John Russell'), ('Canada', 'people born here', 'Henry Williams'), ('Canada', 'people born here', 'James Henry Gundy'), ('Canada', 'people born here', 'Alice Priestley'), ('Canada', 'works', 'Open Secrets'), ('Canada', 'contains', 'Forest Lawn'), ('Canada', 'featured in films', 'Black Bridge'), ('Canada', 'agencies', 'Canadian Radio-television and Telecommunications Commission'), ('Canada', 'contains', 'NorQuest College'), ('Canada', 'contains', 'Dartmouth'), ('Canada', 'people born here', 'Ronit Avni'), ('Canada', 'contains', 'Schwatka Lake'), ('Canada', 'contains', 'Nanisivik Mine'), ('Canada', 'contains', 'Bragg Creek Provincial Park'), ('Canada', 'contains', 'Comfort Cove'), ('Canada', 'contains', 'Garrison Creek'), ('Newfoundland Time Zone', 'locations in this time zone', \"Archie Campbell's Cove\"), ('Canada', 'people born here', 'Ravi Sood'), ('Canada', 'contains', 'Meritus University'), ('Canada', 'people born here', 'Mike Kusiewicz'), ('Canada', 'contains', 'Wards Brook'), ('Canada', 'people born here', 'Manon Charette'), ('Canada', 'contains', 'Buscombe Lake'), ('Canada', 'organizations with this scope', 'Équipe Autonomiste'), ('Canada', 'contains', 'New Perlican'), ('Canada', 'works', \"The Pan-American Dream: Do Latin America's Cultural Values Discourage True Partnership with the United States and Canada?\")]}, 'answer': ['Canada'], 'answer_with_cot': [\"To answer the question, we need to find the entity that is bordering the Great Lakes and uses the local time zone called Newfoundland Time Zone.\\n\\nFirst, let's identify the nodes connected to the Newfoundland Time Zone node. According to the graph, the following entities are connected to the Newfoundland Time Zone:\\n\\n- Archie Campbell's Cove (locations in this time zone)\\n\\nNow, we need to find the entity that borders the Great Lakes. Unfortunately, the graph does not provide explicit information about the entities bordering the Great Lakes. Therefore, we cannot determine the country that borders the Great Lakes and uses the Newfoundland Time Zone based on the given graph.\\n\\nIn order to answer the question accurately, we would need additional information or a more comprehensive knowledge graph that includes the relevant details about the countries bordering the Great Lakes.\", \"('Great Lakes', 'partially containedby', 'Canada')\"], 'difficulty': 'medium', 'from': 'WebQuestions'},\n",
       "       {'task_name': 'graph-language-modeling-graph-relevance-inspection', 'idx': 3625, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikipedia-knowledge-graph\"] {\\n    entity_list = [\\'national team\\', \\'swaziland\\', \\'wanderers\\', \\'27 june\\', \\'footballer\\', \\'sidumo shongwe\\'];\\n    triple_list = [(\"sidumo shongwe\" -> \"swaziland\")[relation=\"place of birth\"], (\"sidumo shongwe\" -> \"footballer\")[relation=\"occupation\"]];\\n}\\n```\\nCaption: Sidumo Shongwe (born 27 June 1981) is a Swazi footballer who plays for Manzini Wanderers and the Swaziland national team.\\nTask definition: A binary classification task to inspect whether the given caption is relevant to the graph. The classes are \"Relevant\" and \"Irrelevant\". Note that: Irrelevance means that all the information mentioned in the caption cannot be found in the graph.\\nQ: Given you a knowledge graph and a caption, please inspect whether the caption is relevant to the graph. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikipedia-knowledge-graph\"] {\\n    entity_list = [\\'national team\\', \\'swaziland\\', \\'wanderers\\', \\'27 june\\', \\'footballer\\', \\'sidumo shongwe\\'];\\n    triple_list = [(\"sidumo shongwe\" -> \"swaziland\")[relation=\"place of birth\"], (\"sidumo shongwe\" -> \"footballer\")[relation=\"occupation\"]];\\n}\\n```', 'graph': {'node_list': ['national team', 'swaziland', 'wanderers', '27 june', 'footballer', 'sidumo shongwe'], 'edge_list': [['sidumo shongwe', 'place of birth', 'swaziland'], ['sidumo shongwe', 'occupation', 'footballer']]}, 'answer': ['Relevant'], 'answer_with_cot': ['To determine whether the given caption is relevant to the graph, we need to check if all the information mentioned in the caption can be found in the graph. \\n\\nStep 1: Extract the information mentioned in the caption.\\nFrom the caption, we can extract the following information:\\n- Sidumo Shongwe is a Swazi footballer.\\n- Sidumo Shongwe plays for Manzini Wanderers and the Swaziland national team.\\n\\nStep 2: Check if the extracted information can be found in the graph.\\n- Is Sidumo Shongwe mentioned in the graph? \\n  Yes, \"Sidumo Shongwe\" is present in the `entity_list` of the graph.\\n\\n- Is there a relation between Sidumo Shongwe and Swaziland?\\n  Yes, there is a relation (\"place of birth\") between \"Sidumo Shongwe\" and \"Swaziland\" in the `triple_list` of the graph.\\n\\n- Is there a relation between Sidumo Shongwe and being a footballer?\\n  Yes, there is a relation (\"occupation\") between \"Sidumo Shongwe\" and \"footballer\" in the `triple_list` of the graph.\\n\\n- Is it mentioned in the graph that Sidumo Shongwe plays for Manzini Wanderers and the Swaziland national team?\\n  No, this information is not mentioned in the graph.\\n\\nStep 3: Determine the relevance of the caption.\\nBased on the above analysis, we can conclude that not all the information mentioned in the caption can be found in the graph. Therefore, the caption is considered \"Irrelevant\" to the graph.'], 'difficulty': 'simple', 'from': 'GraphCaptionGeneration'},\n",
       "       {'task_name': 'graph-language-modeling-graph-node-cls-ogbn-products', 'idx': 12926, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"product-graph\"] {\\n    product_node_list = [\"B0069FDR96\", \"B00BKVEEYQ\", \"B00871KLQ2\", \"B007WL2UL2\", \"B006J44ICC\", \"B0013A0MRW\", \"B00A363EPO\", \"B00BP5GYMM\", \"B008V61Q4Y\", \"B00A6KIJFC\", \"B006YIUK98\", \"B00AH4TJNS\", \"B008VS6ZR0\", \"B00092M386\", \"B00ATB1ISS\", \"B0082XRJ5Q\", \"B00GH390W8\", \"B0017BGR26\", \"B009X75NDU\", \"B006LF04LS\", \"B00CRTBQU0\", \"B00C92OJIG\", \"B009263XRK\", \"B00GU0OYK6\", \"B008OAWF1A\", \"B00CACY0IY\", \"B008BJ4SR8\", \"B00H03VLXU\", \"B0067VFWIQ\", \"B0060GFBY8\", \"B008Y043NS\"];\\n    product_node_feature = [\"B00BKVEEYQ\".category=\"Home.&.Kitchen\", \"B00871KLQ2\".category=\"Beauty\", \"B007WL2UL2\".category=\"Beauty\", \"B006J44ICC\".category=\"Beauty\", \"B0013A0MRW\".category=\"Beauty\", \"B00A363EPO\".category=\"Beauty\", \"B00BP5GYMM\".category=\"Beauty\", \"B008V61Q4Y\".category=\"Beauty\", \"B00A6KIJFC\".category=\"Beauty\", \"B006YIUK98\".category=\"Beauty\", \"B00AH4TJNS\".category=\"Beauty\", \"B008VS6ZR0\".category=\"Beauty\", \"B00092M386\".category=\"Beauty\", \"B00ATB1ISS\".category=\"Beauty\", \"B0082XRJ5Q\".category=\"Beauty\", \"B00GH390W8\".category=\"Beauty\", \"B0017BGR26\".category=\"Beauty\", \"B009X75NDU\".category=\"Beauty\", \"B006LF04LS\".category=\"Beauty\", \"B00CRTBQU0\".category=\"Beauty\", \"B00C92OJIG\".category=\"Beauty\", \"B009263XRK\".category=\"Beauty\", \"B00GU0OYK6\".category=\"Beauty\", \"B008OAWF1A\".category=\"Beauty\", \"B00CACY0IY\".category=\"Beauty\", \"B008BJ4SR8\".category=\"Beauty\", \"B00H03VLXU\".category=\"Beauty\", \"B0067VFWIQ\".category=\"Beauty\", \"B0060GFBY8\".category=\"Beauty\", \"B008Y043NS\".category=\"Beauty\"];\\n    product_triple_list = [(\"B00BKVEEYQ\" -> \"B00871KLQ2\"), (\"B007WL2UL2\" -> \"B006J44ICC\"), (\"B00BKVEEYQ\" -> \"B0013A0MRW\"), (\"B00A363EPO\" -> \"B00BP5GYMM\"), (\"B008V61Q4Y\" -> \"B00A6KIJFC\"), (\"B007WL2UL2\" -> \"B006YIUK98\"), (\"B00AH4TJNS\" -> \"B008VS6ZR0\"), (\"B00BKVEEYQ\" -> \"B00092M386\"), (\"B0069FDR96\" -> \"B00AH4TJNS\"), (\"B00A363EPO\" -> \"B00ATB1ISS\"), (\"B008V61Q4Y\" -> \"B0082XRJ5Q\"), (\"B007WL2UL2\" -> \"B00GH390W8\"), (\"B00BKVEEYQ\" -> \"B0017BGR26\"), (\"B0069FDR96\" -> \"B00BKVEEYQ\"), (\"B00A363EPO\" -> \"B009X75NDU\"), (\"B00AH4TJNS\" -> \"B006LF04LS\"), (\"B00A363EPO\" -> \"B00CRTBQU0\"), (\"B007WL2UL2\" -> \"B00C92OJIG\"), (\"B00AH4TJNS\" -> \"B009263XRK\"), (\"B0069FDR96\" -> \"B008V61Q4Y\"), (\"B008V61Q4Y\" -> \"B00GU0OYK6\"), (\"B00AH4TJNS\" -> \"B008OAWF1A\"), (\"B007WL2UL2\" -> \"B00CACY0IY\"), (\"B008V61Q4Y\" -> \"B008BJ4SR8\"), (\"B0069FDR96\" -> \"B007WL2UL2\"), (\"B00AH4TJNS\" -> \"B00H03VLXU\"), (\"B0069FDR96\" -> \"B00A363EPO\"), (\"B00A363EPO\" -> \"B0067VFWIQ\"), (\"B008V61Q4Y\" -> \"B0060GFBY8\"), (\"B00BKVEEYQ\" -> \"B008Y043NS\")];\\n    target_product_node = \"B0069FDR96\";\\n}\\n```\\nTask definition: given a product and corresponding graph, classify the target product into one of Musical.Instruments, Home.&.Kitchen, Buy.a.Kindle, Camera.&.Photo, Beauty, Luxury.Beauty, Health.&.Personal.Care, Sports.&.Outdoors, Kindle.Store, Automotive.\\nQ: Please classify the target product. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"product-graph\"] {\\n    product_node_list = [\"B0069FDR96\", \"B00BKVEEYQ\", \"B00871KLQ2\", \"B007WL2UL2\", \"B006J44ICC\", \"B0013A0MRW\", \"B00A363EPO\", \"B00BP5GYMM\", \"B008V61Q4Y\", \"B00A6KIJFC\", \"B006YIUK98\", \"B00AH4TJNS\", \"B008VS6ZR0\", \"B00092M386\", \"B00ATB1ISS\", \"B0082XRJ5Q\", \"B00GH390W8\", \"B0017BGR26\", \"B009X75NDU\", \"B006LF04LS\", \"B00CRTBQU0\", \"B00C92OJIG\", \"B009263XRK\", \"B00GU0OYK6\", \"B008OAWF1A\", \"B00CACY0IY\", \"B008BJ4SR8\", \"B00H03VLXU\", \"B0067VFWIQ\", \"B0060GFBY8\", \"B008Y043NS\"];\\n    product_node_feature = [\"B00BKVEEYQ\".category=\"Home.&.Kitchen\", \"B00871KLQ2\".category=\"Beauty\", \"B007WL2UL2\".category=\"Beauty\", \"B006J44ICC\".category=\"Beauty\", \"B0013A0MRW\".category=\"Beauty\", \"B00A363EPO\".category=\"Beauty\", \"B00BP5GYMM\".category=\"Beauty\", \"B008V61Q4Y\".category=\"Beauty\", \"B00A6KIJFC\".category=\"Beauty\", \"B006YIUK98\".category=\"Beauty\", \"B00AH4TJNS\".category=\"Beauty\", \"B008VS6ZR0\".category=\"Beauty\", \"B00092M386\".category=\"Beauty\", \"B00ATB1ISS\".category=\"Beauty\", \"B0082XRJ5Q\".category=\"Beauty\", \"B00GH390W8\".category=\"Beauty\", \"B0017BGR26\".category=\"Beauty\", \"B009X75NDU\".category=\"Beauty\", \"B006LF04LS\".category=\"Beauty\", \"B00CRTBQU0\".category=\"Beauty\", \"B00C92OJIG\".category=\"Beauty\", \"B009263XRK\".category=\"Beauty\", \"B00GU0OYK6\".category=\"Beauty\", \"B008OAWF1A\".category=\"Beauty\", \"B00CACY0IY\".category=\"Beauty\", \"B008BJ4SR8\".category=\"Beauty\", \"B00H03VLXU\".category=\"Beauty\", \"B0067VFWIQ\".category=\"Beauty\", \"B0060GFBY8\".category=\"Beauty\", \"B008Y043NS\".category=\"Beauty\"];\\n    product_triple_list = [(\"B00BKVEEYQ\" -> \"B00871KLQ2\"), (\"B007WL2UL2\" -> \"B006J44ICC\"), (\"B00BKVEEYQ\" -> \"B0013A0MRW\"), (\"B00A363EPO\" -> \"B00BP5GYMM\"), (\"B008V61Q4Y\" -> \"B00A6KIJFC\"), (\"B007WL2UL2\" -> \"B006YIUK98\"), (\"B00AH4TJNS\" -> \"B008VS6ZR0\"), (\"B00BKVEEYQ\" -> \"B00092M386\"), (\"B0069FDR96\" -> \"B00AH4TJNS\"), (\"B00A363EPO\" -> \"B00ATB1ISS\"), (\"B008V61Q4Y\" -> \"B0082XRJ5Q\"), (\"B007WL2UL2\" -> \"B00GH390W8\"), (\"B00BKVEEYQ\" -> \"B0017BGR26\"), (\"B0069FDR96\" -> \"B00BKVEEYQ\"), (\"B00A363EPO\" -> \"B009X75NDU\"), (\"B00AH4TJNS\" -> \"B006LF04LS\"), (\"B00A363EPO\" -> \"B00CRTBQU0\"), (\"B007WL2UL2\" -> \"B00C92OJIG\"), (\"B00AH4TJNS\" -> \"B009263XRK\"), (\"B0069FDR96\" -> \"B008V61Q4Y\"), (\"B008V61Q4Y\" -> \"B00GU0OYK6\"), (\"B00AH4TJNS\" -> \"B008OAWF1A\"), (\"B007WL2UL2\" -> \"B00CACY0IY\"), (\"B008V61Q4Y\" -> \"B008BJ4SR8\"), (\"B0069FDR96\" -> \"B007WL2UL2\"), (\"B00AH4TJNS\" -> \"B00H03VLXU\"), (\"B0069FDR96\" -> \"B00A363EPO\"), (\"B00A363EPO\" -> \"B0067VFWIQ\"), (\"B008V61Q4Y\" -> \"B0060GFBY8\"), (\"B00BKVEEYQ\" -> \"B008Y043NS\")];\\n    target_product_node = \"B0069FDR96\";\\n}\\n```', 'graph': {'node_list': ['B0069FDR96', 'B00BKVEEYQ', 'B00871KLQ2', 'B007WL2UL2', 'B006J44ICC', 'B0013A0MRW', 'B00A363EPO', 'B00BP5GYMM', 'B008V61Q4Y', 'B00A6KIJFC', 'B006YIUK98', 'B00AH4TJNS', 'B008VS6ZR0', 'B00092M386', 'B00ATB1ISS', 'B0082XRJ5Q', 'B00GH390W8', 'B0017BGR26', 'B009X75NDU', 'B006LF04LS', 'B00CRTBQU0', 'B00C92OJIG', 'B009263XRK', 'B00GU0OYK6', 'B008OAWF1A', 'B00CACY0IY', 'B008BJ4SR8', 'B00H03VLXU', 'B0067VFWIQ', 'B0060GFBY8', 'B008Y043NS'], 'edge_list': [('B00BKVEEYQ', 'B00871KLQ2'), ('B007WL2UL2', 'B006J44ICC'), ('B00BKVEEYQ', 'B0013A0MRW'), ('B00A363EPO', 'B00BP5GYMM'), ('B008V61Q4Y', 'B00A6KIJFC'), ('B007WL2UL2', 'B006YIUK98'), ('B00AH4TJNS', 'B008VS6ZR0'), ('B00BKVEEYQ', 'B00092M386'), ('B0069FDR96', 'B00AH4TJNS'), ('B00A363EPO', 'B00ATB1ISS'), ('B008V61Q4Y', 'B0082XRJ5Q'), ('B007WL2UL2', 'B00GH390W8'), ('B00BKVEEYQ', 'B0017BGR26'), ('B0069FDR96', 'B00BKVEEYQ'), ('B00A363EPO', 'B009X75NDU'), ('B00AH4TJNS', 'B006LF04LS'), ('B00A363EPO', 'B00CRTBQU0'), ('B007WL2UL2', 'B00C92OJIG'), ('B00AH4TJNS', 'B009263XRK'), ('B0069FDR96', 'B008V61Q4Y'), ('B008V61Q4Y', 'B00GU0OYK6'), ('B00AH4TJNS', 'B008OAWF1A'), ('B007WL2UL2', 'B00CACY0IY'), ('B008V61Q4Y', 'B008BJ4SR8'), ('B0069FDR96', 'B007WL2UL2'), ('B00AH4TJNS', 'B00H03VLXU'), ('B0069FDR96', 'B00A363EPO'), ('B00A363EPO', 'B0067VFWIQ'), ('B008V61Q4Y', 'B0060GFBY8'), ('B00BKVEEYQ', 'B008Y043NS')], 'node_feature': {'B00BKVEEYQ': {'label': 'Home.&.Kitchen'}, 'B00871KLQ2': {'label': 'Beauty'}, 'B007WL2UL2': {'label': 'Beauty'}, 'B006J44ICC': {'label': 'Beauty'}, 'B0013A0MRW': {'label': 'Beauty'}, 'B00A363EPO': {'label': 'Beauty'}, 'B00BP5GYMM': {'label': 'Beauty'}, 'B008V61Q4Y': {'label': 'Beauty'}, 'B00A6KIJFC': {'label': 'Beauty'}, 'B006YIUK98': {'label': 'Beauty'}, 'B00AH4TJNS': {'label': 'Beauty'}, 'B008VS6ZR0': {'label': 'Beauty'}, 'B00092M386': {'label': 'Beauty'}, 'B00ATB1ISS': {'label': 'Beauty'}, 'B0082XRJ5Q': {'label': 'Beauty'}, 'B00GH390W8': {'label': 'Beauty'}, 'B0017BGR26': {'label': 'Beauty'}, 'B009X75NDU': {'label': 'Beauty'}, 'B006LF04LS': {'label': 'Beauty'}, 'B00CRTBQU0': {'label': 'Beauty'}, 'B00C92OJIG': {'label': 'Beauty'}, 'B009263XRK': {'label': 'Beauty'}, 'B00GU0OYK6': {'label': 'Beauty'}, 'B008OAWF1A': {'label': 'Beauty'}, 'B00CACY0IY': {'label': 'Beauty'}, 'B008BJ4SR8': {'label': 'Beauty'}, 'B00H03VLXU': {'label': 'Beauty'}, 'B0067VFWIQ': {'label': 'Beauty'}, 'B0060GFBY8': {'label': 'Beauty'}, 'B008Y043NS': {'label': 'Beauty'}}}, 'answer': ['Beauty'], 'answer_with_cot': ['To classify the target product, we need to analyze the graph structure and the node information.\\n\\nFirst, let\\'s look at the \"product_triple_list\" which represents the edges between products. The directed edges indicate a relationship between two products. For example, (\"B00BKVEEYQ\" -> \"B00871KLQ2\") suggests that \"B00BKVEEYQ\" is related to \"B00871KLQ2\".\\n\\nNext, let\\'s examine the \"product_node_feature\" which provides additional information about each product node. The format is \"node_id.category=category_name\". For example, \"B00BKVEEYQ\".category=\"Home.&.Kitchen\" tells us that the product \"B00BKVEEYQ\" belongs to the category \"Home & Kitchen\".\\n\\nNow, let\\'s focus on the target product \"B0069FDR96\". We need to find its category by exploring the graph structure.\\n\\nFrom the \"product_triple_list\", we can see that \"B0069FDR96\" is directly connected to several other products. This suggests that there might be a relationship between their categories.\\n\\nBy examining the \"product_node_feature\" for the connected products, we can infer the category of \"B0069FDR96\". In this case, the connected products are: \"B00AH4TJNS\", \"B0013A0MRW\", \"B00A363EPO\", \"B007WL2UL2\", \"B008V61Q4Y\", and \"B009X75NDU\".\\n\\nFrom the \"product_node_feature\", we can determine that all of these connected products belong to the category \"Beauty\". Therefore, we can classify the target product \"B0069FDR96\" into the \"Beauty\" category.\\n\\nSo, the classification for the target product \"B0069FDR96\" is \"Beauty\".'], 'difficulty': 'easy', 'from': 'OGBN-Products'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-wikidata5m', 'idx': 5314, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'1991 Britannica\\', \\'portal:music\\', \\'vocalist\\', \\'Acoustic energy\\', \\'brockhaus and efron encyclopaedia\\', \\'Minmini\\', \\'Books/Art\\', \\'Huamn\\', \\'Television actor\\', \\'ਭਾਰਤ ਗਣਤੰਤਰ\\', \\'Tamil Nadu State Film Award for Best Female Playback\\', \\'meaning (music)\\', \\'media & entertainment\\'];\\n    triple_list = [(\"Minmini\" -> \"Television actor\")[relation=\"occupation\"], (\"Minmini\" -> \"vocalist\")[relation=\"occupation\"], (\"Minmini\" -> \"Tamil Nadu State Film Award for Best Female Playback\")[relation=\"award received\"], (\"Minmini\" -> \"ਭਾਰਤ ਗਣਤੰਤਰ\")[relation=\"country of citizenship\"], (\"Minmini\" -> \"Huamn\")[relation=\"instance of\"], (\"meaning (music)\" -> \"brockhaus and efron encyclopaedia\")[relation=\"described by source\"], (\"meaning (music)\" -> \"1991 Britannica\")[relation=\"described by source\"], (\"meaning (music)\" -> \"portal:music\")[relation=\"topic\\'s main Wikimedia portal\"], (\"meaning (music)\" -> \"Acoustic energy\")[relation=\"has part\"], (\"meaning (music)\" -> \"Books/Art\")[relation=\"subclass of\"], (\"meaning (music)\" -> \"media & entertainment\")[relation=\"subclass of\"]];;\\n    head_entity = \"meaning (music)\";\\n    tail_entity = \"media & entertainment\";\\n}\\n```\\nTask definition: given one head entity and tail entity and corresponding one-hop knowledge sub-graph, classify the relation between head entity and tail entity into one of \"takes place in fictional universe\", \"topic\\'s main Wikimedia portal\", \"cast member\", \"award received\", \"described by source\", \"occupation\", \"flag bearer\", \"type of unit for this property\", \"subclass of\", \"country of citizenship\", \"has part\", \"librettist\", \"instance of\", \"field of work\", \"wears\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'1991 Britannica\\', \\'portal:music\\', \\'vocalist\\', \\'Acoustic energy\\', \\'brockhaus and efron encyclopaedia\\', \\'Minmini\\', \\'Books/Art\\', \\'Huamn\\', \\'Television actor\\', \\'ਭਾਰਤ ਗਣਤੰਤਰ\\', \\'Tamil Nadu State Film Award for Best Female Playback\\', \\'meaning (music)\\', \\'media & entertainment\\'];\\n    triple_list = [(\"Minmini\" -> \"Television actor\")[relation=\"occupation\"], (\"Minmini\" -> \"vocalist\")[relation=\"occupation\"], (\"Minmini\" -> \"Tamil Nadu State Film Award for Best Female Playback\")[relation=\"award received\"], (\"Minmini\" -> \"ਭਾਰਤ ਗਣਤੰਤਰ\")[relation=\"country of citizenship\"], (\"Minmini\" -> \"Huamn\")[relation=\"instance of\"], (\"meaning (music)\" -> \"brockhaus and efron encyclopaedia\")[relation=\"described by source\"], (\"meaning (music)\" -> \"1991 Britannica\")[relation=\"described by source\"], (\"meaning (music)\" -> \"portal:music\")[relation=\"topic\\'s main Wikimedia portal\"], (\"meaning (music)\" -> \"Acoustic energy\")[relation=\"has part\"], (\"meaning (music)\" -> \"Books/Art\")[relation=\"subclass of\"], (\"meaning (music)\" -> \"media & entertainment\")[relation=\"subclass of\"]];;\\n    head_entity = \"meaning (music)\";\\n    tail_entity = \"media & entertainment\";\\n}\\n```', 'graph': {'node_list': ['1991 Britannica', 'portal:music', 'vocalist', 'Acoustic energy', 'brockhaus and efron encyclopaedia', 'Minmini', 'Books/Art', 'Huamn', 'Television actor', 'ਭਾਰਤ ਗਣਤੰਤਰ', 'Tamil Nadu State Film Award for Best Female Playback', 'meaning (music)', 'media & entertainment'], 'edge_list': [('Minmini', 'occupation', 'Television actor'), ('Minmini', 'occupation', 'vocalist'), ('Minmini', 'award received', 'Tamil Nadu State Film Award for Best Female Playback'), ('Minmini', 'country of citizenship', 'ਭਾਰਤ ਗਣਤੰਤਰ'), ('Minmini', 'instance of', 'Huamn'), ('meaning (music)', 'described by source', 'brockhaus and efron encyclopaedia'), ('meaning (music)', 'described by source', '1991 Britannica'), ('meaning (music)', \"topic's main Wikimedia portal\", 'portal:music'), ('meaning (music)', 'has part', 'Acoustic energy'), ('meaning (music)', 'subclass of', 'Books/Art'), ('meaning (music)', 'subclass of', 'media & entertainment')]}, 'answer': ['field of work'], 'answer_with_cot': ['To classify the relation between the head entity \"meaning (music)\" and the tail entity \"media & entertainment\", we need to analyze the provided one-hop knowledge sub-graph and match it with the possible relation types given in the task definition.\\n\\nLooking at the provided sub-graph, we can see the following connections:\\n1. (\"meaning (music)\" -> \"portal:music\") [relation=\"topic\\'s main Wikimedia portal\"]\\n2. (\"meaning (music)\" -> \"media & entertainment\") [relation=\"subclass of\"]\\n\\nBased on these connections, we can classify the relation between the head entity and the tail entity as \"topic\\'s main Wikimedia portal\".'], 'difficulty': 'medium', 'from': 'Wikidata5M'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-wikidata5m', 'idx': 49456, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'firm (economics)\\', \\'Stock Corporation\\', \\'Cambridge (Massachusetts)\\', \\'Drug industry\\', \\'pfizer\\', \\'genetics institute, inc.\\', \\'equine estrogen conjugates\\', \\'Wyeth Pharmaceuticals\\', \\'un/locode:usqmj\\'];\\n    triple_list = [(\"genetics institute, inc.\" -> \"Cambridge (Massachusetts)\")[relation=\"headquarters location\"], (\"genetics institute, inc.\" -> \"firm (economics)\")[relation=\"instance of\"], (\"Wyeth Pharmaceuticals\" -> \"Drug industry\")[relation=\"industry\"], (\"Wyeth Pharmaceuticals\" -> \"Stock Corporation\")[relation=\"legal form\"], (\"Wyeth Pharmaceuticals\" -> \"equine estrogen conjugates\")[relation=\"product or material produced\"], (\"Wyeth Pharmaceuticals\" -> \"pfizer\")[relation=\"owned by\"], (\"Wyeth Pharmaceuticals\" -> \"firm (economics)\")[relation=\"instance of\"], (\"Wyeth Pharmaceuticals\" -> \"un/locode:usqmj\")[relation=\"headquarters location\"]];;\\n    head_entity = \"Wyeth Pharmaceuticals\";\\n    tail_entity = \"un/locode:usqmj\";\\n}\\n```\\nTask definition: given one head entity and tail entity and corresponding one-hop knowledge sub-graph, classify the relation between head entity and tail entity into one of \"owned by\", \"sports season of league or competition\", \"birthday\", \"product or material produced\", \"legal form\", \"taxonomic type\", \"industry\", \"instance of\", \"presenter\", \"followed by\", \"points classification\", \"headquarters location\", \"dan/kyu rank\", \"follows\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'firm (economics)\\', \\'Stock Corporation\\', \\'Cambridge (Massachusetts)\\', \\'Drug industry\\', \\'pfizer\\', \\'genetics institute, inc.\\', \\'equine estrogen conjugates\\', \\'Wyeth Pharmaceuticals\\', \\'un/locode:usqmj\\'];\\n    triple_list = [(\"genetics institute, inc.\" -> \"Cambridge (Massachusetts)\")[relation=\"headquarters location\"], (\"genetics institute, inc.\" -> \"firm (economics)\")[relation=\"instance of\"], (\"Wyeth Pharmaceuticals\" -> \"Drug industry\")[relation=\"industry\"], (\"Wyeth Pharmaceuticals\" -> \"Stock Corporation\")[relation=\"legal form\"], (\"Wyeth Pharmaceuticals\" -> \"equine estrogen conjugates\")[relation=\"product or material produced\"], (\"Wyeth Pharmaceuticals\" -> \"pfizer\")[relation=\"owned by\"], (\"Wyeth Pharmaceuticals\" -> \"firm (economics)\")[relation=\"instance of\"], (\"Wyeth Pharmaceuticals\" -> \"un/locode:usqmj\")[relation=\"headquarters location\"]];;\\n    head_entity = \"Wyeth Pharmaceuticals\";\\n    tail_entity = \"un/locode:usqmj\";\\n}\\n```', 'graph': {'node_list': ['firm (economics)', 'Stock Corporation', 'Cambridge (Massachusetts)', 'Drug industry', 'pfizer', 'genetics institute, inc.', 'equine estrogen conjugates', 'Wyeth Pharmaceuticals', 'un/locode:usqmj'], 'edge_list': [('genetics institute, inc.', 'headquarters location', 'Cambridge (Massachusetts)'), ('genetics institute, inc.', 'instance of', 'firm (economics)'), ('Wyeth Pharmaceuticals', 'industry', 'Drug industry'), ('Wyeth Pharmaceuticals', 'legal form', 'Stock Corporation'), ('Wyeth Pharmaceuticals', 'product or material produced', 'equine estrogen conjugates'), ('Wyeth Pharmaceuticals', 'owned by', 'pfizer'), ('Wyeth Pharmaceuticals', 'instance of', 'firm (economics)'), ('Wyeth Pharmaceuticals', 'headquarters location', 'un/locode:usqmj')]}, 'answer': ['followed by'], 'answer_with_cot': ['First, let\\'s analyze the graph and identify the relation between the head entity (\"Wyeth Pharmaceuticals\") and the tail entity (\"un/locode:usqmj\").\\n\\nThe given graph contains the following triples:\\n1. (\"genetics institute, inc.\" -> \"Cambridge (Massachusetts)\") with relation \"headquarters location\"\\n2. (\"genetics institute, inc.\" -> \"firm (economics)\") with relation \"instance of\"\\n3. (\"Wyeth Pharmaceuticals\" -> \"Drug industry\") with relation \"industry\"\\n4. (\"Wyeth Pharmaceuticals\" -> \"Stock Corporation\") with relation \"legal form\"\\n5. (\"Wyeth Pharmaceuticals\" -> \"equine estrogen conjugates\") with relation \"product or material produced\"\\n6. (\"Wyeth Pharmaceuticals\" -> \"pfizer\") with relation \"owned by\"\\n7. (\"Wyeth Pharmaceuticals\" -> \"firm (economics)\") with relation \"instance of\"\\n8. (\"Wyeth Pharmaceuticals\" -> \"un/locode:usqmj\") with relation \"headquarters location\"\\n\\nFrom the triples, we can see that the relation between the head entity (\"Wyeth Pharmaceuticals\") and the tail entity (\"un/locode:usqmj\") is \"headquarters location\".'], 'difficulty': 'medium', 'from': 'Wikidata5M'},\n",
       "       {'task_name': 'graph-structure-modeling-graph-degree-computing-nlgraph', 'idx': 1091, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"degree-computing\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22];\\n    edge_list = [(0 <-> 14), (0 <-> 12), (0 <-> 2), (0 <-> 3), (1 <-> 13), (1 <-> 22), (1 <-> 7), (1 <-> 11), (1 <-> 19), (1 <-> 6), (1 <-> 8), (2 <-> 14), (2 <-> 20), (2 <-> 3), (3 <-> 14), (3 <-> 20), (4 <-> 21), (4 <-> 18), (4 <-> 5), (4 <-> 17), (4 <-> 9), (4 <-> 15), (4 <-> 10), (5 <-> 21), (5 <-> 17), (5 <-> 9), (5 <-> 15), (5 <-> 10), (6 <-> 16), (6 <-> 13), (6 <-> 22), (6 <-> 7), (6 <-> 11), (6 <-> 19), (6 <-> 8), (7 <-> 16), (7 <-> 13), (7 <-> 22), (7 <-> 8), (8 <-> 16), (8 <-> 13), (8 <-> 11), (8 <-> 19), (9 <-> 18), (9 <-> 17), (9 <-> 15), (9 <-> 10), (10 <-> 21), (10 <-> 18), (11 <-> 16), (11 <-> 13), (11 <-> 22), (11 <-> 19), (12 <-> 14), (12 <-> 20), (13 <-> 16), (13 <-> 19), (14 <-> 20), (15 <-> 21), (15 <-> 18), (15 <-> 17), (16 <-> 22), (17 <-> 21), (17 <-> 18), (19 <-> 22)];\\n    target_node = 17;\\n}```\\nTask definition: calculate the degree of the target node in the graph.\\nQ: What\\'s the degree of the target node? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"degree-computing\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22];\\n    edge_list = [(0 <-> 14), (0 <-> 12), (0 <-> 2), (0 <-> 3), (1 <-> 13), (1 <-> 22), (1 <-> 7), (1 <-> 11), (1 <-> 19), (1 <-> 6), (1 <-> 8), (2 <-> 14), (2 <-> 20), (2 <-> 3), (3 <-> 14), (3 <-> 20), (4 <-> 21), (4 <-> 18), (4 <-> 5), (4 <-> 17), (4 <-> 9), (4 <-> 15), (4 <-> 10), (5 <-> 21), (5 <-> 17), (5 <-> 9), (5 <-> 15), (5 <-> 10), (6 <-> 16), (6 <-> 13), (6 <-> 22), (6 <-> 7), (6 <-> 11), (6 <-> 19), (6 <-> 8), (7 <-> 16), (7 <-> 13), (7 <-> 22), (7 <-> 8), (8 <-> 16), (8 <-> 13), (8 <-> 11), (8 <-> 19), (9 <-> 18), (9 <-> 17), (9 <-> 15), (9 <-> 10), (10 <-> 21), (10 <-> 18), (11 <-> 16), (11 <-> 13), (11 <-> 22), (11 <-> 19), (12 <-> 14), (12 <-> 20), (13 <-> 16), (13 <-> 19), (14 <-> 20), (15 <-> 21), (15 <-> 18), (15 <-> 17), (16 <-> 22), (17 <-> 21), (17 <-> 18), (19 <-> 22)];\\n    target_node = 17;\\n}```', 'graph': {'node_list': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22], 'edge_list': [('0', '14'), ('0', '12'), ('0', '2'), ('0', '3'), ('1', '13'), ('1', '22'), ('1', '7'), ('1', '11'), ('1', '19'), ('1', '6'), ('1', '8'), ('2', '14'), ('2', '20'), ('2', '3'), ('3', '14'), ('3', '20'), ('4', '21'), ('4', '18'), ('4', '5'), ('4', '17'), ('4', '9'), ('4', '15'), ('4', '10'), ('5', '21'), ('5', '17'), ('5', '9'), ('5', '15'), ('5', '10'), ('6', '16'), ('6', '13'), ('6', '22'), ('6', '7'), ('6', '11'), ('6', '19'), ('6', '8'), ('7', '16'), ('7', '13'), ('7', '22'), ('7', '8'), ('8', '16'), ('8', '13'), ('8', '11'), ('8', '19'), ('9', '18'), ('9', '17'), ('9', '15'), ('9', '10'), ('10', '21'), ('10', '18'), ('11', '16'), ('11', '13'), ('11', '22'), ('11', '19'), ('12', '14'), ('12', '20'), ('13', '16'), ('13', '19'), ('14', '20'), ('15', '21'), ('15', '18'), ('15', '17'), ('16', '22'), ('17', '21'), ('17', '18'), ('19', '22')], 'target_node': 17}, 'answer': ['The degree of the target node 17 is 6'], 'answer_with_cot': ['To calculate the degree of the target node, we need to count the number of edges that connect to the target node. \\n\\nLooking at the given graph, we can see that the target node is node 17. \\n\\nTo count the degree, we need to find all the edges that connect to node 17. \\n\\nFrom the given edge_list, we can see that node 17 has edges connecting to nodes 4, 5, 9, 15, 18, and 21. \\n\\nTherefore, the degree of the target node (node 17) is 6.'], 'difficulty': 'easy', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-structure-modeling-graph-cycle-detection-nlgraph', 'idx': 298, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"cycle-detection\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31];\\n    edge_list = [(19 <-> 9), (6 <-> 14), (29 <-> 24), (31 <-> 21), (18 <-> 31), (29 <-> 7), (25 <-> 24), (17 <-> 22), (8 <-> 27), (1 <-> 29), (26 <-> 12), (16 <-> 17), (5 <-> 15), (16 <-> 5), (8 <-> 12), (9 <-> 12), (30 <-> 10), (3 <-> 31), (3 <-> 19), (11 <-> 2), (13 <-> 22), (28 <-> 0), (27 <-> 4), (26 <-> 17), (31 <-> 28), (22 <-> 20), (19 <-> 1), (29 <-> 10), (0 <-> 1), (23 <-> 1), (30 <-> 2), (20 <-> 6)];\\n}\\n```\\nTask definition: determine if there is a cycle in this graph.\\nQ: Is there a cycle in this graph? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"cycle-detection\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31];\\n    edge_list = [(19 <-> 9), (6 <-> 14), (29 <-> 24), (31 <-> 21), (18 <-> 31), (29 <-> 7), (25 <-> 24), (17 <-> 22), (8 <-> 27), (1 <-> 29), (26 <-> 12), (16 <-> 17), (5 <-> 15), (16 <-> 5), (8 <-> 12), (9 <-> 12), (30 <-> 10), (3 <-> 31), (3 <-> 19), (11 <-> 2), (13 <-> 22), (28 <-> 0), (27 <-> 4), (26 <-> 17), (31 <-> 28), (22 <-> 20), (19 <-> 1), (29 <-> 10), (0 <-> 1), (23 <-> 1), (30 <-> 2), (20 <-> 6)];\\n}\\n```', 'graph': {'node_list': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31], 'edge_list': [('19', '9'), ('6', '14'), ('29', '24'), ('31', '21'), ('18', '31'), ('29', '7'), ('25', '24'), ('17', '22'), ('8', '27'), ('1', '29'), ('26', '12'), ('16', '17'), ('5', '15'), ('16', '5'), ('8', '12'), ('9', '12'), ('30', '10'), ('3', '31'), ('3', '19'), ('11', '2'), ('13', '22'), ('28', '0'), ('27', '4'), ('26', '17'), ('31', '28'), ('22', '20'), ('19', '1'), ('29', '10'), ('0', '1'), ('23', '1'), ('30', '2'), ('20', '6')]}, 'answer': ['Yes, there is a cycle in this graph.'], 'answer_with_cot': ['To determine if there is a cycle in the given graph, we can use a depth-first search (DFS) algorithm. Starting from any node, we explore its neighboring nodes and continue the DFS traversal until we either find a previously visited node (indicating a cycle) or we have visited all the nodes in the graph.\\n\\nLet\\'s go through the steps of the DFS algorithm:\\n\\nStep 1: Start at any node (let\\'s choose node 0 in this case).\\n\\nStep 2: Mark the current node as visited.\\n\\nStep 3: For each neighbor of the current node, do the following:\\n   - If the neighbor is not visited, recursively perform DFS on the neighbor.\\n   - If the neighbor is visited and it is not the parent of the current node, then we have found a cycle.\\n\\nStep 4: Repeat steps 2 and 3 for all unvisited nodes in the graph.\\n\\nBased on the provided graph structure and node information, we can start with node 0 and perform the DFS algorithm. If we encounter a previously visited node that is not the parent of the current node, then there is a cycle in the graph.\\n\\nLet\\'s calculate whether there is a cycle in the graph:\\n\\nStarting from node 0, we can visit the following nodes in the DFS traversal: 0 -> 1 -> 19 -> 9 -> 12 -> 8 -> 27 -> 4 -> 26 -> 17 -> 22 -> 13 -> 28 -> 0\\n\\nAs we can see, we visited node 0 twice and it is not the parent of the current node. Therefore, there is a cycle in the graph.\\n\\nSo, the answer to the question \"Is there a cycle in this graph?\" is Yes.'], 'difficulty': 'hard', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-language-modeling-graph-question-answering-grailqa', 'idx': 10880, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'British Columbia Parliament Buildings - Pano - HDR\\', \\'2011 Victoria Film Festival\\', \"Sean O\\'Connor\", \\'Riley McCormick\\', \\'Victoria Conservatory of Music\\', \\'Sarah Kaufman\\', \\'Bill Crawford\\', \\'Andrew Woodruff\\', \\'Cliff Thorburn\\', \\'Gary Kershaw\\', \\'Langdon Auger\\', \\'Governmental Body\\', \\'Melanie McQuaid\\', \\'Tudi Wiggins\\', \\'Camosun College\\', \\'Victoria City Council\\', \\'Vince Perkins\\', \\'Ernie Parkes\\', \\'Robert Powell\\', \\'Erin Fitzgerald\\', \\'Art Chapman\\', \\'Reginald J. Lane\\', \\'Jesse Fibiger\\', \\'Taylor Ellington\\', \\'Victoria Bug Zoo\\', \\'Rhys Duch\\', \\'Victoria\\', \\'Richard Stevenson\\', \\'Megan Heinicke\\'];\\n    triple_list = [(\"Victoria\" -> \"Sean O\\'Connor\")[relation=\"people born here\"], (\"Victoria\" -> \"Megan Heinicke\")[relation=\"people born here\"], (\"Victoria\" -> \"Jesse Fibiger\")[relation=\"people born here\"], (\"Victoria\" -> \"Melanie McQuaid\")[relation=\"people born here\"], (\"Victoria\" -> \"Sarah Kaufman\")[relation=\"people born here\"], (\"Victoria\" -> \"Riley McCormick\")[relation=\"people born here\"], (\"Governmental Body\" -> \"Victoria\")[relation=\"Jurisdiction\"], (\"Victoria\" -> \"Rhys Duch\")[relation=\"people born here\"], (\"Victoria\" -> \"Bill Crawford\")[relation=\"people born here\"], (\"Victoria\" -> \"Vince Perkins\")[relation=\"people born here\"], (\"Victoria\" -> \"Ernie Parkes\")[relation=\"people born here\"], (\"Victoria\" -> \"Victoria Bug Zoo\")[relation=\"tourist attractions\"], (\"Victoria\" -> \"British Columbia Parliament Buildings - Pano - HDR\")[relation=\"image\"], (\"Victoria\" -> \"Richard Stevenson\")[relation=\"people born here\"], (\"Victoria\" -> \"Victoria City Council\")[relation=\"government bodies\"], (\"Victoria\" -> \"Art Chapman\")[relation=\"people born here\"], (\"Victoria\" -> \"Robert Powell\")[relation=\"people born here\"], (\"Victoria\" -> \"Tudi Wiggins\")[relation=\"people born here\"], (\"Victoria\" -> \"Camosun College\")[relation=\"contains\"], (\"Victoria\" -> \"Victoria Conservatory of Music\")[relation=\"contains\"], (\"Victoria\" -> \"Reginald J. Lane\")[relation=\"people born here\"], (\"Victoria\" -> \"Erin Fitzgerald\")[relation=\"people born here\"], (\"Victoria\" -> \"Langdon Auger\")[relation=\"people born here\"], (\"Victoria\" -> \"Taylor Ellington\")[relation=\"people born here\"], (\"Victoria\" -> \"Gary Kershaw\")[relation=\"people born here\"], (\"Victoria\" -> \"Cliff Thorburn\")[relation=\"people born here\"], (\"Victoria\" -> \"Andrew Woodruff\")[relation=\"people born here\"], (\"Victoria\" -> \"2011 Victoria Film Festival\")[relation=\"events\"]];\\n}\\n```\\nTask definition: given a question and answer the question.\\nQ: in which government body has the jurisdiction victoria? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'British Columbia Parliament Buildings - Pano - HDR\\', \\'2011 Victoria Film Festival\\', \"Sean O\\'Connor\", \\'Riley McCormick\\', \\'Victoria Conservatory of Music\\', \\'Sarah Kaufman\\', \\'Bill Crawford\\', \\'Andrew Woodruff\\', \\'Cliff Thorburn\\', \\'Gary Kershaw\\', \\'Langdon Auger\\', \\'Governmental Body\\', \\'Melanie McQuaid\\', \\'Tudi Wiggins\\', \\'Camosun College\\', \\'Victoria City Council\\', \\'Vince Perkins\\', \\'Ernie Parkes\\', \\'Robert Powell\\', \\'Erin Fitzgerald\\', \\'Art Chapman\\', \\'Reginald J. Lane\\', \\'Jesse Fibiger\\', \\'Taylor Ellington\\', \\'Victoria Bug Zoo\\', \\'Rhys Duch\\', \\'Victoria\\', \\'Richard Stevenson\\', \\'Megan Heinicke\\'];\\n    triple_list = [(\"Victoria\" -> \"Sean O\\'Connor\")[relation=\"people born here\"], (\"Victoria\" -> \"Megan Heinicke\")[relation=\"people born here\"], (\"Victoria\" -> \"Jesse Fibiger\")[relation=\"people born here\"], (\"Victoria\" -> \"Melanie McQuaid\")[relation=\"people born here\"], (\"Victoria\" -> \"Sarah Kaufman\")[relation=\"people born here\"], (\"Victoria\" -> \"Riley McCormick\")[relation=\"people born here\"], (\"Governmental Body\" -> \"Victoria\")[relation=\"Jurisdiction\"], (\"Victoria\" -> \"Rhys Duch\")[relation=\"people born here\"], (\"Victoria\" -> \"Bill Crawford\")[relation=\"people born here\"], (\"Victoria\" -> \"Vince Perkins\")[relation=\"people born here\"], (\"Victoria\" -> \"Ernie Parkes\")[relation=\"people born here\"], (\"Victoria\" -> \"Victoria Bug Zoo\")[relation=\"tourist attractions\"], (\"Victoria\" -> \"British Columbia Parliament Buildings - Pano - HDR\")[relation=\"image\"], (\"Victoria\" -> \"Richard Stevenson\")[relation=\"people born here\"], (\"Victoria\" -> \"Victoria City Council\")[relation=\"government bodies\"], (\"Victoria\" -> \"Art Chapman\")[relation=\"people born here\"], (\"Victoria\" -> \"Robert Powell\")[relation=\"people born here\"], (\"Victoria\" -> \"Tudi Wiggins\")[relation=\"people born here\"], (\"Victoria\" -> \"Camosun College\")[relation=\"contains\"], (\"Victoria\" -> \"Victoria Conservatory of Music\")[relation=\"contains\"], (\"Victoria\" -> \"Reginald J. Lane\")[relation=\"people born here\"], (\"Victoria\" -> \"Erin Fitzgerald\")[relation=\"people born here\"], (\"Victoria\" -> \"Langdon Auger\")[relation=\"people born here\"], (\"Victoria\" -> \"Taylor Ellington\")[relation=\"people born here\"], (\"Victoria\" -> \"Gary Kershaw\")[relation=\"people born here\"], (\"Victoria\" -> \"Cliff Thorburn\")[relation=\"people born here\"], (\"Victoria\" -> \"Andrew Woodruff\")[relation=\"people born here\"], (\"Victoria\" -> \"2011 Victoria Film Festival\")[relation=\"events\"]];\\n}\\n```', 'graph': {'node_list': ['British Columbia Parliament Buildings - Pano - HDR', '2011 Victoria Film Festival', \"Sean O'Connor\", 'Riley McCormick', 'Victoria Conservatory of Music', 'Sarah Kaufman', 'Bill Crawford', 'Andrew Woodruff', 'Cliff Thorburn', 'Gary Kershaw', 'Langdon Auger', 'Governmental Body', 'Melanie McQuaid', 'Tudi Wiggins', 'Camosun College', 'Victoria City Council', 'Vince Perkins', 'Ernie Parkes', 'Robert Powell', 'Erin Fitzgerald', 'Art Chapman', 'Reginald J. Lane', 'Jesse Fibiger', 'Taylor Ellington', 'Victoria Bug Zoo', 'Rhys Duch', 'Victoria', 'Richard Stevenson', 'Megan Heinicke'], 'edge_list': [('Victoria', 'people born here', \"Sean O'Connor\"), ('Victoria', 'people born here', 'Megan Heinicke'), ('Victoria', 'people born here', 'Jesse Fibiger'), ('Victoria', 'people born here', 'Melanie McQuaid'), ('Victoria', 'people born here', 'Sarah Kaufman'), ('Victoria', 'people born here', 'Riley McCormick'), ('Governmental Body', 'Jurisdiction', 'Victoria'), ('Victoria', 'people born here', 'Rhys Duch'), ('Victoria', 'people born here', 'Bill Crawford'), ('Victoria', 'people born here', 'Vince Perkins'), ('Victoria', 'people born here', 'Ernie Parkes'), ('Victoria', 'tourist attractions', 'Victoria Bug Zoo'), ('Victoria', 'image', 'British Columbia Parliament Buildings - Pano - HDR'), ('Victoria', 'people born here', 'Richard Stevenson'), ('Victoria', 'government bodies', 'Victoria City Council'), ('Victoria', 'people born here', 'Art Chapman'), ('Victoria', 'people born here', 'Robert Powell'), ('Victoria', 'people born here', 'Tudi Wiggins'), ('Victoria', 'contains', 'Camosun College'), ('Victoria', 'contains', 'Victoria Conservatory of Music'), ('Victoria', 'people born here', 'Reginald J. Lane'), ('Victoria', 'people born here', 'Erin Fitzgerald'), ('Victoria', 'people born here', 'Langdon Auger'), ('Victoria', 'people born here', 'Taylor Ellington'), ('Victoria', 'people born here', 'Gary Kershaw'), ('Victoria', 'people born here', 'Cliff Thorburn'), ('Victoria', 'people born here', 'Andrew Woodruff'), ('Victoria', 'events', '2011 Victoria Film Festival')]}, 'answer': ['Victoria City Council'], 'answer_with_cot': ['According to the graph, the government body that has jurisdiction over Victoria is the \"Governmental Body\".', \"('Victoria', 'government bodies', 'Victoria City Council')\"], 'difficulty': 'medium', 'from': 'GrailQA'},\n",
       "       {'task_name': 'graph-language-modeling-graph-relevance-inspection', 'idx': 12049, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikipedia-knowledge-graph\"] {\\n    entity_list = [\\'covers\\', \\'village\\', \\'historical records\\', \\'žilina district\\', \\'municipality\\', \\'the village\\', \\'archive\\', \\'people\\', \\'altitude\\', \\'metres\\', \\'slovakia\\', \\'the state\\', \\'žilina region\\', \\'northern\\', \\'research\\', \\'records\\'];\\n    triple_list = [(\"žilina district\" -> \"žilina region\")[relation=\"located in the administrative territorial entity\"], (\"žilina district\" -> \"slovakia\")[relation=\"country\"], (\"slovakia\" -> \"žilina region\")[relation=\"contains administrative territorial entity\"], (\"žilina region\" -> \"slovakia\")[relation=\"country\"], (\"žilina region\" -> \"žilina district\")[relation=\"contains administrative territorial entity\"]];\\n}\\n```\\nCaption: Hôrky is a village and municipality in Žilina District in the Žilina Region of northern Slovakia. In historical records the village was first mentioned in 1393. The municipality lies at an altitude of 375 metres and covers an area of 2.318\\xa0km². It has a population of about 615 people. The records for genealogical research are available at the state archive \"Statny Archiv in Bytca, Slovakia\"\\nTask definition: A binary classification task to inspect whether the given caption is relevant to the graph. The classes are \"Relevant\" and \"Irrelevant\". Note that: Irrelevance means that all the information mentioned in the caption cannot be found in the graph.\\nQ: Given you a knowledge graph and a caption, please inspect whether the caption is relevant to the graph. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikipedia-knowledge-graph\"] {\\n    entity_list = [\\'covers\\', \\'village\\', \\'historical records\\', \\'žilina district\\', \\'municipality\\', \\'the village\\', \\'archive\\', \\'people\\', \\'altitude\\', \\'metres\\', \\'slovakia\\', \\'the state\\', \\'žilina region\\', \\'northern\\', \\'research\\', \\'records\\'];\\n    triple_list = [(\"žilina district\" -> \"žilina region\")[relation=\"located in the administrative territorial entity\"], (\"žilina district\" -> \"slovakia\")[relation=\"country\"], (\"slovakia\" -> \"žilina region\")[relation=\"contains administrative territorial entity\"], (\"žilina region\" -> \"slovakia\")[relation=\"country\"], (\"žilina region\" -> \"žilina district\")[relation=\"contains administrative territorial entity\"]];\\n}\\n```', 'graph': {'node_list': ['covers', 'village', 'historical records', 'žilina district', 'municipality', 'the village', 'archive', 'people', 'altitude', 'metres', 'slovakia', 'the state', 'žilina region', 'northern', 'research', 'records'], 'edge_list': [['žilina district', 'located in the administrative territorial entity', 'žilina region'], ['žilina district', 'country', 'slovakia'], ['slovakia', 'contains administrative territorial entity', 'žilina region'], ['žilina region', 'country', 'slovakia'], ['žilina region', 'contains administrative territorial entity', 'žilina district']]}, 'answer': ['Relevant'], 'answer_with_cot': ['To determine whether the caption is relevant to the graph, we need to compare the information mentioned in the caption with the information present in the graph.\\n\\nStep 1: Analyze the caption:\\n- The caption mentions that Hôrky is a village and municipality in Žilina District in the Žilina Region of northern Slovakia.\\n- It also mentions that the village was first mentioned in 1393.\\n- The municipality lies at an altitude of 375 meters and covers an area of 2.318 km².\\n- The population of the municipality is about 615 people.\\n- The records for genealogical research are available at the state archive \"Statny Archiv in Bytca, Slovakia\".\\n\\nStep 2: Compare the information with the graph:\\n- The graph contains information about the \"žilina district\", \"žilina region\", and \"slovakia\", which match the geographical references in the caption.\\n- The graph also includes relations between these entities, such as \"located in the administrative territorial entity\" and \"contains administrative territorial entity\".\\n\\nStep 3: Conclusion:\\nBased on the comparison, we can see that the information mentioned in the caption, such as the geographical references, Hôrky being a village, altitude, and even the availability of genealogical records, can be found in the graph. Therefore, the caption is relevant to the graph.\\n\\nFinal Answer: Relevant'], 'difficulty': 'simple', 'from': 'GraphCaptionGeneration'},\n",
       "       {'task_name': 'graph-structure-modeling-graph-hamilton-path-nlgraph', 'idx': 86, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"hamilton-path\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];\\n    edge_list = [(0 <-> 12), (0 <-> 2), (0 <-> 11), (0 <-> 7), (0 <-> 9), (0 <-> 4), (0 <-> 3), (0 <-> 6), (1 <-> 9), (1 <-> 6), (1 <-> 3), (1 <-> 8), (1 <-> 7), (2 <-> 4), (2 <-> 12), (2 <-> 6), (2 <-> 7), (2 <-> 10), (2 <-> 3), (3 <-> 7), (3 <-> 5), (3 <-> 12), (3 <-> 8), (3 <-> 10), (4 <-> 11), (4 <-> 8), (4 <-> 5), (4 <-> 6), (4 <-> 12), (5 <-> 11), (5 <-> 10), (5 <-> 6), (5 <-> 8), (5 <-> 7), (6 <-> 7), (6 <-> 8), (6 <-> 10), (7 <-> 9), (7 <-> 12), (7 <-> 10), (7 <-> 8), (8 <-> 9), (8 <-> 12), (9 <-> 11), (9 <-> 12), (10 <-> 12), (10 <-> 11)];\\n}\\n```\\nTask definition: determine if there is a path that visits every node exactly once in this graph.\\nQ: Is there a path in this graph that visits every node exactly once? If yes, give the path. Note that in a path, adjacent nodes must be connected with edges. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"hamilton-path\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];\\n    edge_list = [(0 <-> 12), (0 <-> 2), (0 <-> 11), (0 <-> 7), (0 <-> 9), (0 <-> 4), (0 <-> 3), (0 <-> 6), (1 <-> 9), (1 <-> 6), (1 <-> 3), (1 <-> 8), (1 <-> 7), (2 <-> 4), (2 <-> 12), (2 <-> 6), (2 <-> 7), (2 <-> 10), (2 <-> 3), (3 <-> 7), (3 <-> 5), (3 <-> 12), (3 <-> 8), (3 <-> 10), (4 <-> 11), (4 <-> 8), (4 <-> 5), (4 <-> 6), (4 <-> 12), (5 <-> 11), (5 <-> 10), (5 <-> 6), (5 <-> 8), (5 <-> 7), (6 <-> 7), (6 <-> 8), (6 <-> 10), (7 <-> 9), (7 <-> 12), (7 <-> 10), (7 <-> 8), (8 <-> 9), (8 <-> 12), (9 <-> 11), (9 <-> 12), (10 <-> 12), (10 <-> 11)];\\n}\\n```', 'graph': {'node_list': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], 'edge_list': [('0', '12'), ('0', '2'), ('0', '11'), ('0', '7'), ('0', '9'), ('0', '4'), ('0', '3'), ('0', '6'), ('1', '9'), ('1', '6'), ('1', '3'), ('1', '8'), ('1', '7'), ('2', '4'), ('2', '12'), ('2', '6'), ('2', '7'), ('2', '10'), ('2', '3'), ('3', '7'), ('3', '5'), ('3', '12'), ('3', '8'), ('3', '10'), ('4', '11'), ('4', '8'), ('4', '5'), ('4', '6'), ('4', '12'), ('5', '11'), ('5', '10'), ('5', '6'), ('5', '8'), ('5', '7'), ('6', '7'), ('6', '8'), ('6', '10'), ('7', '9'), ('7', '12'), ('7', '10'), ('7', '8'), ('8', '9'), ('8', '12'), ('9', '11'), ('9', '12'), ('10', '12'), ('10', '11')]}, 'answer': ['Yes. The path can be: 0,6,10,11,9,12,8,7,5,4,2,3,1'], 'answer_with_cot': ['To determine if there is a path that visits every node exactly once in this graph, we can use the concept of Hamiltonian path. A Hamiltonian path is a path in a graph that visits every node exactly once.\\nChecking the given graph, we see that it represents a Hamiltonian path problem, denoted by the name \"hamilton-path\". The graph has 13 nodes (0 to 12) and several undirected edges connecting the nodes.\\n\\nTo find if there is a Hamiltonian path in this graph, we need to analyze the connectivity between the nodes.\\n\\nAnalyzing the given edge_list, we can see that there are multiple edges between different nodes, which indicates that the graph is connected. This is essential for the existence of a Hamiltonian path.\\n\\nBased on the graph structure and the analysis above, we can conclude that there exists a path in this graph that visits every node exactly once.\\n\\nTo find the path, we need to traverse the graph. Starting from any node, we can follow the edges to move to adjacent nodes. The path will continue until we visit all the nodes in the graph exactly once.\\n\\nHere is a possible Hamiltonian path in this graph:\\n0 -> 12 -> 4 -> 11 -> 9 -> 1 -> 8 -> 3 -> 2 -> 10 -> 6 -> 5 -> 7'], 'difficulty': 'hard', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-wikidata5m', 'idx': 1311, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'P:I\\', \\'Comuni\\', \\'Veronella\\', \\'UTC2\\', \\'Roveredo di Gua\\', \\'Pressana\\', \\'Minerbe\\', \\'montagnana\\', \\'cologna veneta\\', \\'belfiore\\', \\'Zimella\\', \\'rome time\\', \\'arcole\\', \\'verona (province)\\', \\'bonavigo\\'];\\n    triple_list = [(\"Pressana\" -> \"Comuni\")[relation=\"instance of\"], (\"Pressana\" -> \"P:I\")[relation=\"country\"], (\"Pressana\" -> \"verona (province)\")[relation=\"located in the administrative territorial entity\"], (\"Pressana\" -> \"Roveredo di Gua\")[relation=\"shares border with\"], (\"Pressana\" -> \"Minerbe\")[relation=\"shares border with\"], (\"Pressana\" -> \"cologna veneta\")[relation=\"shares border with\"], (\"Pressana\" -> \"montagnana\")[relation=\"shares border with\"], (\"Pressana\" -> \"UTC2\")[relation=\"located in time zone\"], (\"Pressana\" -> \"rome time\")[relation=\"located in time zone\"], (\"Veronella\" -> \"arcole\")[relation=\"shares border with\"], (\"Veronella\" -> \"bonavigo\")[relation=\"shares border with\"], (\"Veronella\" -> \"belfiore\")[relation=\"shares border with\"], (\"Veronella\" -> \"Zimella\")[relation=\"shares border with\"], (\"Veronella\" -> \"Comuni\")[relation=\"instance of\"], (\"Veronella\" -> \"UTC2\")[relation=\"located in time zone\"], (\"Veronella\" -> \"rome time\")[relation=\"located in time zone\"], (\"Veronella\" -> \"P:I\")[relation=\"country\"], (\"Veronella\" -> \"verona (province)\")[relation=\"located in the administrative territorial entity\"]];;\\n    head_entity = \"Veronella\";\\n    tail_entity = \"verona (province)\";\\n}\\n```\\nTask definition: given one head entity and tail entity and corresponding one-hop knowledge sub-graph, classify the relation between head entity and tail entity into one of \"mouthpiece\", \"exhibition history\", \"investigated by\", \"valvetrain configuration\", \"shares border with\", \"located in the administrative territorial entity\", \"instance of\", \"minor planet group\", \"present in work\", \"country\", \"located in time zone\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'P:I\\', \\'Comuni\\', \\'Veronella\\', \\'UTC2\\', \\'Roveredo di Gua\\', \\'Pressana\\', \\'Minerbe\\', \\'montagnana\\', \\'cologna veneta\\', \\'belfiore\\', \\'Zimella\\', \\'rome time\\', \\'arcole\\', \\'verona (province)\\', \\'bonavigo\\'];\\n    triple_list = [(\"Pressana\" -> \"Comuni\")[relation=\"instance of\"], (\"Pressana\" -> \"P:I\")[relation=\"country\"], (\"Pressana\" -> \"verona (province)\")[relation=\"located in the administrative territorial entity\"], (\"Pressana\" -> \"Roveredo di Gua\")[relation=\"shares border with\"], (\"Pressana\" -> \"Minerbe\")[relation=\"shares border with\"], (\"Pressana\" -> \"cologna veneta\")[relation=\"shares border with\"], (\"Pressana\" -> \"montagnana\")[relation=\"shares border with\"], (\"Pressana\" -> \"UTC2\")[relation=\"located in time zone\"], (\"Pressana\" -> \"rome time\")[relation=\"located in time zone\"], (\"Veronella\" -> \"arcole\")[relation=\"shares border with\"], (\"Veronella\" -> \"bonavigo\")[relation=\"shares border with\"], (\"Veronella\" -> \"belfiore\")[relation=\"shares border with\"], (\"Veronella\" -> \"Zimella\")[relation=\"shares border with\"], (\"Veronella\" -> \"Comuni\")[relation=\"instance of\"], (\"Veronella\" -> \"UTC2\")[relation=\"located in time zone\"], (\"Veronella\" -> \"rome time\")[relation=\"located in time zone\"], (\"Veronella\" -> \"P:I\")[relation=\"country\"], (\"Veronella\" -> \"verona (province)\")[relation=\"located in the administrative territorial entity\"]];;\\n    head_entity = \"Veronella\";\\n    tail_entity = \"verona (province)\";\\n}\\n```', 'graph': {'node_list': ['P:I', 'Comuni', 'Veronella', 'UTC2', 'Roveredo di Gua', 'Pressana', 'Minerbe', 'montagnana', 'cologna veneta', 'belfiore', 'Zimella', 'rome time', 'arcole', 'verona (province)', 'bonavigo'], 'edge_list': [('Pressana', 'instance of', 'Comuni'), ('Pressana', 'country', 'P:I'), ('Pressana', 'located in the administrative territorial entity', 'verona (province)'), ('Pressana', 'shares border with', 'Roveredo di Gua'), ('Pressana', 'shares border with', 'Minerbe'), ('Pressana', 'shares border with', 'cologna veneta'), ('Pressana', 'shares border with', 'montagnana'), ('Pressana', 'located in time zone', 'UTC2'), ('Pressana', 'located in time zone', 'rome time'), ('Veronella', 'shares border with', 'arcole'), ('Veronella', 'shares border with', 'bonavigo'), ('Veronella', 'shares border with', 'belfiore'), ('Veronella', 'shares border with', 'Zimella'), ('Veronella', 'instance of', 'Comuni'), ('Veronella', 'located in time zone', 'UTC2'), ('Veronella', 'located in time zone', 'rome time'), ('Veronella', 'country', 'P:I'), ('Veronella', 'located in the administrative territorial entity', 'verona (province)')]}, 'answer': ['shares border with'], 'answer_with_cot': ['To classify the relation between the head entity \"Veronella\" and the tail entity \"verona (province)\", we need to analyze the given one-hop knowledge sub-graph. \\n\\nLooking at the triple list, we can see that there is a directed edge from \"Veronella\" to \"verona (province)\" with the relation \"located in the administrative territorial entity\". Therefore, the relation between the head entity and tail entity is \"located in the administrative territorial entity\".'], 'difficulty': 'medium', 'from': 'Wikidata5M'},\n",
       "       {'task_name': 'graph-structure-modeling-graph-shortest-path-nlgraph', 'idx': 247, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"shortest-path\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];\\n    edge_list = [(0 <-> 3)[weight=2], (0 <-> 7)[weight=9], (0 <-> 8)[weight=4], (0 <-> 13)[weight=8], (1 <-> 4)[weight=10], (2 <-> 17)[weight=6], (2 <-> 4)[weight=10], (2 <-> 3)[weight=8], (2 <-> 16)[weight=9], (3 <-> 12)[weight=10], (4 <-> 6)[weight=9], (4 <-> 12)[weight=3], (4 <-> 9)[weight=5], (5 <-> 7)[weight=1], (5 <-> 8)[weight=5], (5 <-> 13)[weight=10], (6 <-> 13)[weight=7], (7 <-> 11)[weight=1], (7 <-> 14)[weight=9], (8 <-> 10)[weight=3], (8 <-> 13)[weight=10], (9 <-> 17)[weight=1], (9 <-> 11)[weight=7], (9 <-> 14)[weight=1], (10 <-> 17)[weight=3], (10 <-> 11)[weight=2], (10 <-> 16)[weight=10], (10 <-> 15)[weight=10], (11 <-> 17)[weight=1]];\\n}\\n```\\nTask definition: find a shortest path between two nodes in the graph, and calculate the sum of the weights in the shortest path.\\nQ: Give the shortest path from node 1 to node 15. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"shortest-path\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];\\n    edge_list = [(0 <-> 3)[weight=2], (0 <-> 7)[weight=9], (0 <-> 8)[weight=4], (0 <-> 13)[weight=8], (1 <-> 4)[weight=10], (2 <-> 17)[weight=6], (2 <-> 4)[weight=10], (2 <-> 3)[weight=8], (2 <-> 16)[weight=9], (3 <-> 12)[weight=10], (4 <-> 6)[weight=9], (4 <-> 12)[weight=3], (4 <-> 9)[weight=5], (5 <-> 7)[weight=1], (5 <-> 8)[weight=5], (5 <-> 13)[weight=10], (6 <-> 13)[weight=7], (7 <-> 11)[weight=1], (7 <-> 14)[weight=9], (8 <-> 10)[weight=3], (8 <-> 13)[weight=10], (9 <-> 17)[weight=1], (9 <-> 11)[weight=7], (9 <-> 14)[weight=1], (10 <-> 17)[weight=3], (10 <-> 11)[weight=2], (10 <-> 16)[weight=10], (10 <-> 15)[weight=10], (11 <-> 17)[weight=1]];\\n}\\n```', 'graph': {'node_list': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], 'edge_list': [('0', '2', '3'), ('0', '9', '7'), ('0', '4', '8'), ('0', '8', '13'), ('1', '10', '4'), ('2', '6', '17'), ('2', '10', '4'), ('2', '8', '3'), ('2', '9', '16'), ('3', '10', '12'), ('4', '9', '6'), ('4', '3', '12'), ('4', '5', '9'), ('5', '1', '7'), ('5', '5', '8'), ('5', '10', '13'), ('6', '7', '13'), ('7', '1', '11'), ('7', '9', '14'), ('8', '3', '10'), ('8', '10', '13'), ('9', '1', '17'), ('9', '7', '11'), ('9', '1', '14'), ('10', '3', '17'), ('10', '2', '11'), ('10', '10', '16'), ('10', '10', '15'), ('11', '1', '17')]}, 'answer': ['The shortest path from node 1 to node 15 is 1,4,9,17,10,15 with a total weight of 29'], 'answer_with_cot': [\"To find the shortest path from node 1 to node 15, we can use Dijkstra's algorithm or a similar graph traversal algorithm.\\n\\nStarting from node 1, we will explore the neighboring nodes and their respective weights. We will then update the shortest path and the sum of weights for each node as we traverse the graph.\\n\\nHere are the steps to find the shortest path from node 1 to node 15:\\n\\n1. Start at node 1.\\n2. Check the neighboring nodes of node 1 and their respective weights:\\n   - Node 1 is connected to Node 4 with a weight of 10.\\n   - Node 1 is not directly connected to Node 15, so we will move on.\\n3. As of now, the current shortest path to reach Node 4 is through Node 1 with a weight of 10.\\n4. Check the neighboring nodes of Node 4 and their respective weights:\\n   - Node 4 is not directly connected to Node 15, so we will move on.\\n5. As of now, the current shortest path to reach Node 4 is through Node 1 with a weight of 10.\\n6. Continue exploring the nodes and updating the shortest path until we reach Node 15.\\n   - Node 4 is connected to Node 9 with a weight of 5.\\n   - Node 9 is connected to Node 14 with a weight of 1.\\n   - Node 14 is connected to Node 11 with a weight of 1.\\n   - Node 11 is connected to Node 17 with a weight of 1.\\n   - Node 17 is connected to Node 10 with a weight of 3.\\n   - Node 10 is connected to Node 15 with a weight of 10.\\n7. We have reached Node 15, and the current shortest path to reach it is: 1 -> 4 -> 9 -> 14 -> 11 -> 17 -> 10 -> 15.\\n8. The sum of weights in the shortest path is: 10 + 5 + 1 + 1 + 1 + 3 + 10 = 31.\\n\\nTherefore, the shortest path from node 1 to node 15 is 1 -> 4 -> 9 -> 14 -> 11 -> 17 -> 10 -> 15, with a sum of weights equal to 31.\"], 'difficulty': 'hard', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-wikidata5m', 'idx': 64689, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'united national party\\', \\'professions\\', \\'career diplomat\\', \\'mahinda college\\', \\'Sinhala People\\', \\'rupa karunathilake\\', \\'political jargon\\', \\'Srilanka\\', \\'Huamn\\', \\'malalasekara theatre\\', \\'Politician\\'];\\n    triple_list = [(\"rupa karunathilake\" -> \"career diplomat\")[relation=\"occupation\"], (\"rupa karunathilake\" -> \"Huamn\")[relation=\"instance of\"], (\"rupa karunathilake\" -> \"mahinda college\")[relation=\"educated at\"], (\"rupa karunathilake\" -> \"malalasekara theatre\")[relation=\"educated at\"], (\"rupa karunathilake\" -> \"Srilanka\")[relation=\"country of citizenship\"], (\"rupa karunathilake\" -> \"Sinhala People\")[relation=\"ethnic group\"], (\"rupa karunathilake\" -> \"united national party\")[relation=\"member of political party\"], (\"Politician\" -> \"political jargon\")[relation=\"field of this occupation\"], (\"Politician\" -> \"professions\")[relation=\"instance of\"]];;\\n    head_entity = \"Politician\";\\n    tail_entity = \"professions\";\\n}\\n```\\nTask definition: given one head entity and tail entity and corresponding one-hop knowledge sub-graph, classify the relation between head entity and tail entity into one of \"diocese\", \"sports season of league or competition\", \"occupation\", \"educated at\", \"country of citizenship\", \"family name\", \"ethnic group\", \"lithography\", \"emergency phone number\", \"instance of\", \"member of political party\", \"space tug\", \"field of this occupation\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'united national party\\', \\'professions\\', \\'career diplomat\\', \\'mahinda college\\', \\'Sinhala People\\', \\'rupa karunathilake\\', \\'political jargon\\', \\'Srilanka\\', \\'Huamn\\', \\'malalasekara theatre\\', \\'Politician\\'];\\n    triple_list = [(\"rupa karunathilake\" -> \"career diplomat\")[relation=\"occupation\"], (\"rupa karunathilake\" -> \"Huamn\")[relation=\"instance of\"], (\"rupa karunathilake\" -> \"mahinda college\")[relation=\"educated at\"], (\"rupa karunathilake\" -> \"malalasekara theatre\")[relation=\"educated at\"], (\"rupa karunathilake\" -> \"Srilanka\")[relation=\"country of citizenship\"], (\"rupa karunathilake\" -> \"Sinhala People\")[relation=\"ethnic group\"], (\"rupa karunathilake\" -> \"united national party\")[relation=\"member of political party\"], (\"Politician\" -> \"political jargon\")[relation=\"field of this occupation\"], (\"Politician\" -> \"professions\")[relation=\"instance of\"]];;\\n    head_entity = \"Politician\";\\n    tail_entity = \"professions\";\\n}\\n```', 'graph': {'node_list': ['united national party', 'professions', 'career diplomat', 'mahinda college', 'Sinhala People', 'rupa karunathilake', 'political jargon', 'Srilanka', 'Huamn', 'malalasekara theatre', 'Politician'], 'edge_list': [('rupa karunathilake', 'occupation', 'career diplomat'), ('rupa karunathilake', 'instance of', 'Huamn'), ('rupa karunathilake', 'educated at', 'mahinda college'), ('rupa karunathilake', 'educated at', 'malalasekara theatre'), ('rupa karunathilake', 'country of citizenship', 'Srilanka'), ('rupa karunathilake', 'ethnic group', 'Sinhala People'), ('rupa karunathilake', 'member of political party', 'united national party'), ('Politician', 'field of this occupation', 'political jargon'), ('Politician', 'instance of', 'professions')]}, 'answer': ['occupation'], 'answer_with_cot': ['To classify the relation between the head entity \"Politician\" and the tail entity \"professions\", we need to examine the given one-hop knowledge sub-graph.\\n\\nLooking at the triple_list, we can see that there is a directed edge from \"Politician\" to \"professions\" with the relation \"instance of\". This indicates that the head entity \"Politician\" is an instance of the tail entity \"professions\". Therefore, we can classify the relation as \"instance of\".'], 'difficulty': 'medium', 'from': 'Wikidata5M'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-conceptnet', 'idx': 17291, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"conceptnet-knowledge-graph\"] {\\n    entity_list = [\\'right wrong\\', \\'storm enemy castle\\', \\'right\\', \\'opposite of leave\\', \\'christian\\', \\'confess sin\\', \\'rebel\\', \\'commit sin\\', \\'opposite of wrong\\', \\'bring offer\\', \\'please christ\\', \\'enjoy break rule\\', \\'rationalize sin\\'];\\n    triple_list = [(\"right\" -> \"opposite of leave\")[relation=\"HasProperty\"], (\"christian\" -> \"commit sin\")[relation=\"CapableOf\"], (\"christian\" -> \"please christ\")[relation=\"Desires\"], (\"christian\" -> \"right\")[relation=\"HasProperty\"], (\"right\" -> \"opposite of leave\")[relation=\"DefinedAs\"], (\"right\" -> \"right wrong\")[relation=\"CapableOf\"], (\"christian\" -> \"rationalize sin\")[relation=\"CapableOf\"], (\"christian\" -> \"bring offer\")[relation=\"CapableOf\"], (\"christian\" -> \"confess sin\")[relation=\"CapableOf\"], (\"right\" -> \"opposite of wrong\")[relation=\"DefinedAs\"], (\"rebel\" -> \"storm enemy castle\")[relation=\"CapableOf\"], (\"rebel\" -> \"enjoy break rule\")[relation=\"CapableOf\"]];;\\n    head_entity = \"rebel\";\\n    tail_entity = \"enjoy break rule\";\\n}\\n```\\nTask definition: given a head entity and a tail entity, and each entity may has a text description and a knowledge sub-graph, classify the relation between head entity and tail entity into one of \"IsA\", \"HasPainIntensity\", \"CapableOf\", \"HasA\", \"HasLastSubevent\", \"HasProperty\", \"Desires\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"conceptnet-knowledge-graph\"] {\\n    entity_list = [\\'right wrong\\', \\'storm enemy castle\\', \\'right\\', \\'opposite of leave\\', \\'christian\\', \\'confess sin\\', \\'rebel\\', \\'commit sin\\', \\'opposite of wrong\\', \\'bring offer\\', \\'please christ\\', \\'enjoy break rule\\', \\'rationalize sin\\'];\\n    triple_list = [(\"right\" -> \"opposite of leave\")[relation=\"HasProperty\"], (\"christian\" -> \"commit sin\")[relation=\"CapableOf\"], (\"christian\" -> \"please christ\")[relation=\"Desires\"], (\"christian\" -> \"right\")[relation=\"HasProperty\"], (\"right\" -> \"opposite of leave\")[relation=\"DefinedAs\"], (\"right\" -> \"right wrong\")[relation=\"CapableOf\"], (\"christian\" -> \"rationalize sin\")[relation=\"CapableOf\"], (\"christian\" -> \"bring offer\")[relation=\"CapableOf\"], (\"christian\" -> \"confess sin\")[relation=\"CapableOf\"], (\"right\" -> \"opposite of wrong\")[relation=\"DefinedAs\"], (\"rebel\" -> \"storm enemy castle\")[relation=\"CapableOf\"], (\"rebel\" -> \"enjoy break rule\")[relation=\"CapableOf\"]];;\\n    head_entity = \"rebel\";\\n    tail_entity = \"enjoy break rule\";\\n}\\n```', 'graph': {'node_list': ['right wrong', 'storm enemy castle', 'right', 'opposite of leave', 'christian', 'confess sin', 'rebel', 'commit sin', 'opposite of wrong', 'bring offer', 'please christ', 'enjoy break rule', 'rationalize sin'], 'edge_list': [('right', 'HasProperty', 'opposite of leave'), ('christian', 'CapableOf', 'commit sin'), ('christian', 'Desires', 'please christ'), ('christian', 'HasProperty', 'right'), ('right', 'DefinedAs', 'opposite of leave'), ('right', 'CapableOf', 'right wrong'), ('christian', 'CapableOf', 'rationalize sin'), ('christian', 'CapableOf', 'bring offer'), ('christian', 'CapableOf', 'confess sin'), ('right', 'DefinedAs', 'opposite of wrong'), ('rebel', 'CapableOf', 'storm enemy castle'), ('rebel', 'CapableOf', 'enjoy break rule')]}, 'answer': ['CapableOf'], 'answer_with_cot': ['To classify the relation between the head entity \"rebel\" and the tail entity \"enjoy break rule\", we need to analyze the graph structure and node information provided.\\n\\n1. Head Entity: \"rebel\"\\n- Description/Information: N/A\\n\\n2. Tail Entity: \"enjoy break rule\"\\n- Description/Information: N/A\\n\\n3. Graph Structure:\\n- This knowledge graph consists of a set of entities and a set of triples that represent relationships between those entities.\\n- The graph contains both directed and undirected edges.\\n\\n4. Triple List:\\n- (\"rebel\" -> \"storm enemy castle\")[relation=\"CapableOf\"]\\n- (\"rebel\" -> \"enjoy break rule\")[relation=\"CapableOf\"]\\n\\nBased on the provided triple list, we can see that the relation between the head entity \"rebel\" and the tail entity \"enjoy break rule\" is \"CapableOf\".\\n\\nTherefore, the relation between the head entity \"rebel\" and the tail entity \"enjoy break rule\" is classified as \"CapableOf\".'], 'difficulty': 'medium', 'from': 'ConceptNet'},\n",
       "       {'task_name': 'graph-language-modeling-graph-question-answering-pathquestion', 'idx': 839, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'catherine_of_braganza\\', \\'henrietta_maria_of_france\\', \\'charles_i_of_england\\', \\'exeter\\', \\'dunfermline\\', \\'roman_catholic_church\\', \\'gaudiya_vaishnavism\\', \\'monarch\\', \\'anne_hyde\\', \\'male\\', \\'henrietta_anne_stuart\\', \\'henry_iv_of_france\\', \\'james_ii_of_england\\', \\'princess_elizabeth_of_england\\', \\'louis_xiii_of_france\\', \\'gaston_duke_of_orleans\\', \\'pau\\', \\'palace_of_whitehall\\', \\'henry_frederick_prince_of_wales\\', \\'female\\', \\'elizabeth_of_bohemia\\', \\'charles_ii_of_england\\', \\'kingdom_of_france\\', \\'anne_of_denmark\\', \\'henry_fitzroy_1st_duke_of_grafton\\', \\'james_i_of_england\\', \\'charles_fitzcharles_1st_earl_of_plymouth\\', \\'marie_de_medici\\'];\\n    triple_list = [(\"henrietta_maria_of_france\" -> \"female\")[relation=\"gender\"], (\"princess_elizabeth_of_england\" -> \"henrietta_maria_of_france\")[relation=\"parents\"], (\"james_i_of_england\" -> \"elizabeth_of_bohemia\")[relation=\"children\"], (\"charles_ii_of_england\" -> \"male\")[relation=\"gender\"], (\"charles_ii_of_england\" -> \"gaudiya_vaishnavism\")[relation=\"religion\"], (\"charles_i_of_england\" -> \"dunfermline\")[relation=\"place_of_birth\"], (\"charles_i_of_england\" -> \"male\")[relation=\"gender\"], (\"henry_iv_of_france\" -> \"pau\")[relation=\"place_of_birth\"], (\"james_i_of_england\" -> \"anne_of_denmark\")[relation=\"spouse\"], (\"henry_iv_of_france\" -> \"louis_xiii_of_france\")[relation=\"children\"], (\"charles_ii_of_england\" -> \"henry_fitzroy_1st_duke_of_grafton\")[relation=\"children\"], (\"marie_de_medici\" -> \"louis_xiii_of_france\")[relation=\"children\"], (\"henrietta_maria_of_france\" -> \"charles_i_of_england\")[relation=\"spouse\"], (\"princess_elizabeth_of_england\" -> \"female\")[relation=\"gender\"], (\"henrietta_maria_of_france\" -> \"marie_de_medici\")[relation=\"parents\"], (\"charles_ii_of_england\" -> \"charles_fitzcharles_1st_earl_of_plymouth\")[relation=\"children\"], (\"anne_of_denmark\" -> \"james_i_of_england\")[relation=\"spouse\"], (\"henrietta_maria_of_france\" -> \"kingdom_of_france\")[relation=\"nationality\"], (\"james_ii_of_england\" -> \"anne_hyde\")[relation=\"spouse\"], (\"james_ii_of_england\" -> \"roman_catholic_church\")[relation=\"religion\"], (\"charles_i_of_england\" -> \"palace_of_whitehall\")[relation=\"place_of_death\"], (\"princess_elizabeth_of_england\" -> \"charles_i_of_england\")[relation=\"parents\"], (\"marie_de_medici\" -> \"gaston_duke_of_orleans\")[relation=\"children\"], (\"charles_i_of_england\" -> \"monarch\")[relation=\"profession\"], (\"henrietta_anne_stuart\" -> \"exeter\")[relation=\"place_of_birth\"], (\"charles_ii_of_england\" -> \"catherine_of_braganza\")[relation=\"spouse\"], (\"james_i_of_england\" -> \"henry_frederick_prince_of_wales\")[relation=\"children\"]];\\n}\\n```\\nTask definition: given a question and factual knowledge graph, find an entity and a reasoning path in the graph to answer the question.\\nQ: the nation of princess_elizabeth_of_england \\'s mother ? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'catherine_of_braganza\\', \\'henrietta_maria_of_france\\', \\'charles_i_of_england\\', \\'exeter\\', \\'dunfermline\\', \\'roman_catholic_church\\', \\'gaudiya_vaishnavism\\', \\'monarch\\', \\'anne_hyde\\', \\'male\\', \\'henrietta_anne_stuart\\', \\'henry_iv_of_france\\', \\'james_ii_of_england\\', \\'princess_elizabeth_of_england\\', \\'louis_xiii_of_france\\', \\'gaston_duke_of_orleans\\', \\'pau\\', \\'palace_of_whitehall\\', \\'henry_frederick_prince_of_wales\\', \\'female\\', \\'elizabeth_of_bohemia\\', \\'charles_ii_of_england\\', \\'kingdom_of_france\\', \\'anne_of_denmark\\', \\'henry_fitzroy_1st_duke_of_grafton\\', \\'james_i_of_england\\', \\'charles_fitzcharles_1st_earl_of_plymouth\\', \\'marie_de_medici\\'];\\n    triple_list = [(\"henrietta_maria_of_france\" -> \"female\")[relation=\"gender\"], (\"princess_elizabeth_of_england\" -> \"henrietta_maria_of_france\")[relation=\"parents\"], (\"james_i_of_england\" -> \"elizabeth_of_bohemia\")[relation=\"children\"], (\"charles_ii_of_england\" -> \"male\")[relation=\"gender\"], (\"charles_ii_of_england\" -> \"gaudiya_vaishnavism\")[relation=\"religion\"], (\"charles_i_of_england\" -> \"dunfermline\")[relation=\"place_of_birth\"], (\"charles_i_of_england\" -> \"male\")[relation=\"gender\"], (\"henry_iv_of_france\" -> \"pau\")[relation=\"place_of_birth\"], (\"james_i_of_england\" -> \"anne_of_denmark\")[relation=\"spouse\"], (\"henry_iv_of_france\" -> \"louis_xiii_of_france\")[relation=\"children\"], (\"charles_ii_of_england\" -> \"henry_fitzroy_1st_duke_of_grafton\")[relation=\"children\"], (\"marie_de_medici\" -> \"louis_xiii_of_france\")[relation=\"children\"], (\"henrietta_maria_of_france\" -> \"charles_i_of_england\")[relation=\"spouse\"], (\"princess_elizabeth_of_england\" -> \"female\")[relation=\"gender\"], (\"henrietta_maria_of_france\" -> \"marie_de_medici\")[relation=\"parents\"], (\"charles_ii_of_england\" -> \"charles_fitzcharles_1st_earl_of_plymouth\")[relation=\"children\"], (\"anne_of_denmark\" -> \"james_i_of_england\")[relation=\"spouse\"], (\"henrietta_maria_of_france\" -> \"kingdom_of_france\")[relation=\"nationality\"], (\"james_ii_of_england\" -> \"anne_hyde\")[relation=\"spouse\"], (\"james_ii_of_england\" -> \"roman_catholic_church\")[relation=\"religion\"], (\"charles_i_of_england\" -> \"palace_of_whitehall\")[relation=\"place_of_death\"], (\"princess_elizabeth_of_england\" -> \"charles_i_of_england\")[relation=\"parents\"], (\"marie_de_medici\" -> \"gaston_duke_of_orleans\")[relation=\"children\"], (\"charles_i_of_england\" -> \"monarch\")[relation=\"profession\"], (\"henrietta_anne_stuart\" -> \"exeter\")[relation=\"place_of_birth\"], (\"charles_ii_of_england\" -> \"catherine_of_braganza\")[relation=\"spouse\"], (\"james_i_of_england\" -> \"henry_frederick_prince_of_wales\")[relation=\"children\"]];\\n}\\n```', 'graph': {'node_list': ['catherine_of_braganza', 'henrietta_maria_of_france', 'charles_i_of_england', 'exeter', 'dunfermline', 'roman_catholic_church', 'gaudiya_vaishnavism', 'monarch', 'anne_hyde', 'male', 'henrietta_anne_stuart', 'henry_iv_of_france', 'james_ii_of_england', 'princess_elizabeth_of_england', 'louis_xiii_of_france', 'gaston_duke_of_orleans', 'pau', 'palace_of_whitehall', 'henry_frederick_prince_of_wales', 'female', 'elizabeth_of_bohemia', 'charles_ii_of_england', 'kingdom_of_france', 'anne_of_denmark', 'henry_fitzroy_1st_duke_of_grafton', 'james_i_of_england', 'charles_fitzcharles_1st_earl_of_plymouth', 'marie_de_medici'], 'edge_list': [('henrietta_maria_of_france', 'gender', 'female'), ('princess_elizabeth_of_england', 'parents', 'henrietta_maria_of_france'), ('james_i_of_england', 'children', 'elizabeth_of_bohemia'), ('charles_ii_of_england', 'gender', 'male'), ('charles_ii_of_england', 'religion', 'gaudiya_vaishnavism'), ('charles_i_of_england', 'place_of_birth', 'dunfermline'), ('charles_i_of_england', 'gender', 'male'), ('henry_iv_of_france', 'place_of_birth', 'pau'), ('james_i_of_england', 'spouse', 'anne_of_denmark'), ('henry_iv_of_france', 'children', 'louis_xiii_of_france'), ('charles_ii_of_england', 'children', 'henry_fitzroy_1st_duke_of_grafton'), ('marie_de_medici', 'children', 'louis_xiii_of_france'), ('henrietta_maria_of_france', 'spouse', 'charles_i_of_england'), ('princess_elizabeth_of_england', 'gender', 'female'), ('henrietta_maria_of_france', 'parents', 'marie_de_medici'), ('charles_ii_of_england', 'children', 'charles_fitzcharles_1st_earl_of_plymouth'), ('anne_of_denmark', 'spouse', 'james_i_of_england'), ('henrietta_maria_of_france', 'nationality', 'kingdom_of_france'), ('james_ii_of_england', 'spouse', 'anne_hyde'), ('james_ii_of_england', 'religion', 'roman_catholic_church'), ('charles_i_of_england', 'place_of_death', 'palace_of_whitehall'), ('princess_elizabeth_of_england', 'parents', 'charles_i_of_england'), ('marie_de_medici', 'children', 'gaston_duke_of_orleans'), ('charles_i_of_england', 'profession', 'monarch'), ('henrietta_anne_stuart', 'place_of_birth', 'exeter'), ('charles_ii_of_england', 'spouse', 'catherine_of_braganza'), ('james_i_of_england', 'children', 'henry_frederick_prince_of_wales')]}, 'answer': ['kingdom_of_france'], 'answer_with_cot': ['To answer the question \"the nation of princess_elizabeth_of_england\\'s mother?\", we need to trace the reasoning path in the given graph.\\n\\n1. Start with the node \"princess_elizabeth_of_england\" and search for outgoing edges. We find an edge labeled \"parents\" pointing to the node \"henrietta_maria_of_france\".\\n2. Follow the edge from \"princess_elizabeth_of_england\" to \"henrietta_maria_of_france\".\\n3. Now, search for incoming edges to \"henrietta_maria_of_france\" and find an edge labeled \"parents\" pointing to the node \"marie_de_medici\".\\n4. Follow the edge from \"henrietta_maria_of_france\" to \"marie_de_medici\".\\n5. Finally, search for incoming edges to \"marie_de_medici\" and find an edge labeled \"nationality\" pointing to the node \"kingdom_of_france\".\\n\\nTherefore, the nation of princess_elizabeth_of_england\\'s mother is \"kingdom_of_france\".', \"[('princess_elizabeth_of_england', 'parents', 'henrietta_maria_of_france'), ('henrietta_maria_of_france', 'nationality', 'kingdom_of_france')]\"], 'difficulty': 'simple', 'from': 'PathQuestion'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-wikidata5m', 'idx': 7632, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'Mystery (television)\\', \\'genres in cinema\\', \\'Fugitives for a Night\\', \\'List of mystery films\\', \\'leslie goodwins\\', \\'united stated\\', \\'magic film\\', \\'black-and-white cinema\\', \\'frank albertson\\', \\'RKO Pictures\\', \\'Number of words in English\\', \\'movie\\'];\\n    triple_list = [(\"Fugitives for a Night\" -> \"movie\")[relation=\"instance of\"], (\"Fugitives for a Night\" -> \"RKO Pictures\")[relation=\"production company\"], (\"Fugitives for a Night\" -> \"leslie goodwins\")[relation=\"director\"], (\"Fugitives for a Night\" -> \"black-and-white cinema\")[relation=\"color\"], (\"Fugitives for a Night\" -> \"frank albertson\")[relation=\"cast member\"], (\"Fugitives for a Night\" -> \"Number of words in English\")[relation=\"original language of film or TV show\"], (\"Fugitives for a Night\" -> \"united stated\")[relation=\"country of origin\"], (\"magic film\" -> \"movie\")[relation=\"subclass of\"], (\"magic film\" -> \"Mystery (television)\")[relation=\"subclass of\"], (\"magic film\" -> \"List of mystery films\")[relation=\"has list\"], (\"magic film\" -> \"genres in cinema\")[relation=\"instance of\"]];;\\n    head_entity = \"magic film\";\\n    tail_entity = \"genres in cinema\";\\n}\\n```\\nTask definition: given one head entity and tail entity and corresponding one-hop knowledge sub-graph, classify the relation between head entity and tail entity into one of \"located on terrain feature\", \"cast member\", \"has list\", \"type locality (geology)\", \"doctoral thesis\", \"subclass of\", \"production company\", \"director\", \"cover art by\", \"color\", \"instance of\", \"original language of film or TV show\", \"country of origin\", \"has effect\", \"genre\", \"gene inversion association with\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'Mystery (television)\\', \\'genres in cinema\\', \\'Fugitives for a Night\\', \\'List of mystery films\\', \\'leslie goodwins\\', \\'united stated\\', \\'magic film\\', \\'black-and-white cinema\\', \\'frank albertson\\', \\'RKO Pictures\\', \\'Number of words in English\\', \\'movie\\'];\\n    triple_list = [(\"Fugitives for a Night\" -> \"movie\")[relation=\"instance of\"], (\"Fugitives for a Night\" -> \"RKO Pictures\")[relation=\"production company\"], (\"Fugitives for a Night\" -> \"leslie goodwins\")[relation=\"director\"], (\"Fugitives for a Night\" -> \"black-and-white cinema\")[relation=\"color\"], (\"Fugitives for a Night\" -> \"frank albertson\")[relation=\"cast member\"], (\"Fugitives for a Night\" -> \"Number of words in English\")[relation=\"original language of film or TV show\"], (\"Fugitives for a Night\" -> \"united stated\")[relation=\"country of origin\"], (\"magic film\" -> \"movie\")[relation=\"subclass of\"], (\"magic film\" -> \"Mystery (television)\")[relation=\"subclass of\"], (\"magic film\" -> \"List of mystery films\")[relation=\"has list\"], (\"magic film\" -> \"genres in cinema\")[relation=\"instance of\"]];;\\n    head_entity = \"magic film\";\\n    tail_entity = \"genres in cinema\";\\n}\\n```', 'graph': {'node_list': ['Mystery (television)', 'genres in cinema', 'Fugitives for a Night', 'List of mystery films', 'leslie goodwins', 'united stated', 'magic film', 'black-and-white cinema', 'frank albertson', 'RKO Pictures', 'Number of words in English', 'movie'], 'edge_list': [('Fugitives for a Night', 'instance of', 'movie'), ('Fugitives for a Night', 'production company', 'RKO Pictures'), ('Fugitives for a Night', 'director', 'leslie goodwins'), ('Fugitives for a Night', 'color', 'black-and-white cinema'), ('Fugitives for a Night', 'cast member', 'frank albertson'), ('Fugitives for a Night', 'original language of film or TV show', 'Number of words in English'), ('Fugitives for a Night', 'country of origin', 'united stated'), ('magic film', 'subclass of', 'movie'), ('magic film', 'subclass of', 'Mystery (television)'), ('magic film', 'has list', 'List of mystery films'), ('magic film', 'instance of', 'genres in cinema')]}, 'answer': ['genre'], 'answer_with_cot': ['To classify the relation between the head entity \"magic film\" and the tail entity \"genres in cinema\", we need to look at the provided knowledge sub-graph.\\n\\nThe graph contains information about various connections involving the head and tail entities. We can examine the triple_list to identify the relation between the head entity and tail entity.\\n\\nBased on the provided graph, we can see that there is a directed edge from \"magic film\" to \"genres in cinema\" with the relation \"instance of\". Therefore, we can classify the relation between the head entity \"magic film\" and the tail entity \"genres in cinema\" as \"instance of\".'], 'difficulty': 'medium', 'from': 'Wikidata5M'},\n",
       "       {'task_name': 'graph-structure-modeling-graph-connectivity-detection-nlgraph', 'idx': 3, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"connectivity-detection\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];\\n    edge_list = [(0 <-> 11), (0 <-> 6), (0 <-> 2), (0 <-> 5), (1 <-> 7), (1 <-> 16), (1 <-> 14), (1 <-> 17), (1 <-> 3), (1 <-> 9), (1 <-> 13), (1 <-> 10), (2 <-> 11), (2 <-> 6), (2 <-> 5), (3 <-> 7), (3 <-> 16), (3 <-> 14), (3 <-> 17), (3 <-> 9), (3 <-> 13), (3 <-> 10), (4 <-> 8), (4 <-> 15), (4 <-> 12), (5 <-> 11), (5 <-> 6), (6 <-> 11), (7 <-> 16), (7 <-> 14), (7 <-> 17), (7 <-> 9), (7 <-> 13), (7 <-> 10), (8 <-> 15), (8 <-> 12), (9 <-> 16), (9 <-> 14), (9 <-> 17), (9 <-> 13), (9 <-> 10), (10 <-> 16), (10 <-> 14), (10 <-> 17), (10 <-> 13), (12 <-> 15), (13 <-> 16), (13 <-> 14), (13 <-> 17), (14 <-> 16), (14 <-> 17), (16 <-> 17)];\\n}\\n```\\nTask definition: determine if there is a path between two nodes in the graph.\\nQ: Is there a path between node 6 and node 4? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"connectivity-detection\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];\\n    edge_list = [(0 <-> 11), (0 <-> 6), (0 <-> 2), (0 <-> 5), (1 <-> 7), (1 <-> 16), (1 <-> 14), (1 <-> 17), (1 <-> 3), (1 <-> 9), (1 <-> 13), (1 <-> 10), (2 <-> 11), (2 <-> 6), (2 <-> 5), (3 <-> 7), (3 <-> 16), (3 <-> 14), (3 <-> 17), (3 <-> 9), (3 <-> 13), (3 <-> 10), (4 <-> 8), (4 <-> 15), (4 <-> 12), (5 <-> 11), (5 <-> 6), (6 <-> 11), (7 <-> 16), (7 <-> 14), (7 <-> 17), (7 <-> 9), (7 <-> 13), (7 <-> 10), (8 <-> 15), (8 <-> 12), (9 <-> 16), (9 <-> 14), (9 <-> 17), (9 <-> 13), (9 <-> 10), (10 <-> 16), (10 <-> 14), (10 <-> 17), (10 <-> 13), (12 <-> 15), (13 <-> 16), (13 <-> 14), (13 <-> 17), (14 <-> 16), (14 <-> 17), (16 <-> 17)];\\n}\\n```', 'graph': {'node_list': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], 'edge_list': [('0', '11'), ('0', '6'), ('0', '2'), ('0', '5'), ('1', '7'), ('1', '16'), ('1', '14'), ('1', '17'), ('1', '3'), ('1', '9'), ('1', '13'), ('1', '10'), ('2', '11'), ('2', '6'), ('2', '5'), ('3', '7'), ('3', '16'), ('3', '14'), ('3', '17'), ('3', '9'), ('3', '13'), ('3', '10'), ('4', '8'), ('4', '15'), ('4', '12'), ('5', '11'), ('5', '6'), ('6', '11'), ('7', '16'), ('7', '14'), ('7', '17'), ('7', '9'), ('7', '13'), ('7', '10'), ('8', '15'), ('8', '12'), ('9', '16'), ('9', '14'), ('9', '17'), ('9', '13'), ('9', '10'), ('10', '16'), ('10', '14'), ('10', '17'), ('10', '13'), ('12', '15'), ('13', '16'), ('13', '14'), ('13', '17'), ('14', '16'), ('14', '17'), ('16', '17')]}, 'answer': ['The answer is no.'], 'answer_with_cot': ['To determine if there is a path between node 6 and node 4, we can follow the edges in the graph and see if we can reach from node 6 to node 4.\\n\\nStarting at node 6, we see that it is connected to node 0, node 2, node 5, and node 11. \\n\\nNext, we check if any of these nodes have a direct connection to node 4. None of them do.\\n\\nSince none of the nodes connected to node 6 have a direct connection to node 4, we cannot reach node 4 starting from node 6.\\n\\nTherefore, there is no path between node 6 and node 4 in the given graph.'], 'difficulty': 'medium', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-conceptnet', 'idx': 25425, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"conceptnet-knowledge-graph\"] {\\n    entity_list = [\\'be sleepy\\', \\'have rest\\', \\'can get asleep easily\\', \"most precious part of one\\'s life\", \\'go to sleep\\', \\'get tire\\', \\'buy the return tickets\\', \\'a tool\\', \\'be tire\\', \\'infinite\\', \\'plan your itinerary\\', \\'travel\\', \\'you need to plan your routes nicely\\', \\'not neccesarily linear\\', \\'see new places\\', \\'measure a sequence of events\\', \\'go to bed\\', \\'linear concept\\', \\'stop\\', \\'change relatively fast\\', \\'theoretical\\', \\'time\\', \\'choose a destination\\', \\'take a break\\'];\\n    triple_list = [(\"travel\" -> \"buy the return tickets\")[relation=\"HasLastSubevent\"], (\"time\" -> \"change relatively fast\")[relation=\"IsA\"], (\"time\" -> \"infinite\")[relation=\"HasProperty\"], (\"travel\" -> \"see new places\")[relation=\"MotivatedByGoal\"], (\"time\" -> \"measure a sequence of events\")[relation=\"UsedFor\"], (\"travel\" -> \"you need to plan your routes nicely\")[relation=\"MotivatedByGoal\"], (\"time\" -> \"not neccesarily linear\")[relation=\"IsA\"], (\"get tire\" -> \"go to sleep\")[relation=\"Causes\"], (\"time\" -> \"linear concept\")[relation=\"IsA\"], (\"travel\" -> \"plan your itinerary\")[relation=\"HasFirstSubevent\"], (\"time\" -> \"theoretical\")[relation=\"HasProperty\"], (\"time\" -> \"a tool\")[relation=\"IsA\"], (\"time\" -> \"most precious part of one\\'s life\")[relation=\"DefinedAs\"], (\"travel\" -> \"choose a destination\")[relation=\"HasFirstSubevent\"], (\"stop\" -> \"take a break\")[relation=\"MotivatedByGoal\"], (\"be sleepy\" -> \"be tire\")[relation=\"HasSubevent\"], (\"be tire\" -> \"go to bed\")[relation=\"CausesDesire\"], (\"be tire\" -> \"can get asleep easily\")[relation=\"HasSubevent\"], (\"be tire\" -> \"have rest\")[relation=\"CausesDesire\"]];;\\n    head_entity = \"be tire\";\\n    tail_entity = \"have rest\";\\n}\\n```\\nTask definition: given a head entity and a tail entity, and each entity may has a text description and a knowledge sub-graph, classify the relation between head entity and tail entity into one of \"UsedFor\", \"LocationOfAction\", \"CausesDesire\", \"HasPrerequisite\", \"MotivatedByGoal\", \"Causes\", \"HasFirstSubevent\", \"IsA\", \"CapableOf\", \"HasLastSubevent\", \"HasSubevent\", \"HasProperty\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"conceptnet-knowledge-graph\"] {\\n    entity_list = [\\'be sleepy\\', \\'have rest\\', \\'can get asleep easily\\', \"most precious part of one\\'s life\", \\'go to sleep\\', \\'get tire\\', \\'buy the return tickets\\', \\'a tool\\', \\'be tire\\', \\'infinite\\', \\'plan your itinerary\\', \\'travel\\', \\'you need to plan your routes nicely\\', \\'not neccesarily linear\\', \\'see new places\\', \\'measure a sequence of events\\', \\'go to bed\\', \\'linear concept\\', \\'stop\\', \\'change relatively fast\\', \\'theoretical\\', \\'time\\', \\'choose a destination\\', \\'take a break\\'];\\n    triple_list = [(\"travel\" -> \"buy the return tickets\")[relation=\"HasLastSubevent\"], (\"time\" -> \"change relatively fast\")[relation=\"IsA\"], (\"time\" -> \"infinite\")[relation=\"HasProperty\"], (\"travel\" -> \"see new places\")[relation=\"MotivatedByGoal\"], (\"time\" -> \"measure a sequence of events\")[relation=\"UsedFor\"], (\"travel\" -> \"you need to plan your routes nicely\")[relation=\"MotivatedByGoal\"], (\"time\" -> \"not neccesarily linear\")[relation=\"IsA\"], (\"get tire\" -> \"go to sleep\")[relation=\"Causes\"], (\"time\" -> \"linear concept\")[relation=\"IsA\"], (\"travel\" -> \"plan your itinerary\")[relation=\"HasFirstSubevent\"], (\"time\" -> \"theoretical\")[relation=\"HasProperty\"], (\"time\" -> \"a tool\")[relation=\"IsA\"], (\"time\" -> \"most precious part of one\\'s life\")[relation=\"DefinedAs\"], (\"travel\" -> \"choose a destination\")[relation=\"HasFirstSubevent\"], (\"stop\" -> \"take a break\")[relation=\"MotivatedByGoal\"], (\"be sleepy\" -> \"be tire\")[relation=\"HasSubevent\"], (\"be tire\" -> \"go to bed\")[relation=\"CausesDesire\"], (\"be tire\" -> \"can get asleep easily\")[relation=\"HasSubevent\"], (\"be tire\" -> \"have rest\")[relation=\"CausesDesire\"]];;\\n    head_entity = \"be tire\";\\n    tail_entity = \"have rest\";\\n}\\n```', 'graph': {'node_list': ['be sleepy', 'have rest', 'can get asleep easily', \"most precious part of one's life\", 'go to sleep', 'get tire', 'buy the return tickets', 'a tool', 'be tire', 'infinite', 'plan your itinerary', 'travel', 'you need to plan your routes nicely', 'not neccesarily linear', 'see new places', 'measure a sequence of events', 'go to bed', 'linear concept', 'stop', 'change relatively fast', 'theoretical', 'time', 'choose a destination', 'take a break'], 'edge_list': [('travel', 'HasLastSubevent', 'buy the return tickets'), ('time', 'IsA', 'change relatively fast'), ('time', 'HasProperty', 'infinite'), ('travel', 'MotivatedByGoal', 'see new places'), ('time', 'UsedFor', 'measure a sequence of events'), ('travel', 'MotivatedByGoal', 'you need to plan your routes nicely'), ('time', 'IsA', 'not neccesarily linear'), ('get tire', 'Causes', 'go to sleep'), ('time', 'IsA', 'linear concept'), ('travel', 'HasFirstSubevent', 'plan your itinerary'), ('time', 'HasProperty', 'theoretical'), ('time', 'IsA', 'a tool'), ('time', 'DefinedAs', \"most precious part of one's life\"), ('travel', 'HasFirstSubevent', 'choose a destination'), ('stop', 'MotivatedByGoal', 'take a break'), ('be sleepy', 'HasSubevent', 'be tire'), ('be tire', 'CausesDesire', 'go to bed'), ('be tire', 'HasSubevent', 'can get asleep easily'), ('be tire', 'CausesDesire', 'have rest')]}, 'answer': ['HasSubevent'], 'answer_with_cot': ['To classify the relation between the head entity \"be tire\" and the tail entity \"have rest\", we need to analyze the knowledge sub-graph provided and identify the relevant edges connecting these entities.\\n\\nLooking at the triple_list in the graph, we can see that the following edges connect the head entity and tail entity:\\n- (\"be tire\" -> \"go to bed\")[relation=\"CausesDesire\"]\\n- (\"be tire\" -> \"have rest\")[relation=\"CausesDesire\"]\\n\\nFrom the above connections, we can infer that the relation between the head entity \"be tire\" and the tail entity \"have rest\" is \"CausesDesire\".'], 'difficulty': 'medium', 'from': 'ConceptNet'},\n",
       "       {'task_name': 'graph-language-modeling-graph-question-answering-wc2014', 'idx': 5047, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"football-worldcup-knowledge-base\"] {\\n    entity_list = [\\'Johnny_ACOSTA\\', \\'Azubuike_EGWUEKWE\\', \\'Club_America\\', \\'Defender\\', \\'WILLIAM\\', \\'Ezequiel_GARAY\\', \\'5\\', \\'Francisco_RODRIGUEZ\\', \\'14\\', \\'Godfrey_OBOABONA\\', \\'YUN_Sukyoung\\', \\'Alireza_HAGHIGHI\\', \\'BSC_Young_Boys\\', \\'LUIS_NETO\\', \\'Joel_VELTMAN\\', \\'Cristian_ZAPATA\\', \\'Stephan_LICHTSTEINER\\', \\'Steve_VON_BERGEN\\', \\'Canada\\', \\'Mehrdad_POOLADI\\', \\'Paul_AGUILAR\\', \\'2\\', \\'Oscar_BAGUI\\', \\'Amirhossein_SADEGHI\\', \\'EDER\\', \\'Arthur_BOKA\\', \\'3\\', \\'VfB_Stuttgart\\', \\'18\\', \\'Jerome_BOATENG\\', \\'Jose_CHOLEVAS\\', \\'SL_Benfica\\', \\'KIM_Younggwon\\', \\'Greece\\', \\'Diego_REYES\\', \\'Jackson_MARTINEZ\\', \\'Netherlands\\', \\'Portugal\\', \\'25\\', \\'Steven_BEITASHOUR\\', \\'Constant_DJAKPA\\', \\'6\\'];\\n    triple_list = [(\"LUIS_NETO\" -> \"Defender\")[relation=\"plays_position\"], (\"Arthur_BOKA\" -> \"VfB_Stuttgart\")[relation=\"plays_in_club\"], (\"Jose_CHOLEVAS\" -> \"Greece\")[relation=\"plays_for_country\"], (\"Portugal\" -> \"WILLIAM\")[relation=\"plays_for_country_inverse\"], (\"Constant_DJAKPA\" -> \"18\")[relation=\"wears_number\"], (\"Paul_AGUILAR\" -> \"Defender\")[relation=\"plays_position\"], (\"Stephan_LICHTSTEINER\" -> \"2\")[relation=\"wears_number\"], (\"Portugal\" -> \"Alireza_HAGHIGHI\")[relation=\"plays_for_country_inverse\"], (\"Jerome_BOATENG\" -> \"25\")[relation=\"is_aged\"], (\"Azubuike_EGWUEKWE\" -> \"6\")[relation=\"wears_number\"], (\"Portugal\" -> \"Jackson_MARTINEZ\")[relation=\"plays_for_country_inverse\"], (\"Francisco_RODRIGUEZ\" -> \"Club_America\")[relation=\"plays_in_club\"], (\"Ezequiel_GARAY\" -> \"SL_Benfica\")[relation=\"plays_in_club\"], (\"Oscar_BAGUI\" -> \"Defender\")[relation=\"plays_position\"], (\"Joel_VELTMAN\" -> \"Netherlands\")[relation=\"plays_for_country\"], (\"Cristian_ZAPATA\" -> \"2\")[relation=\"wears_number\"], (\"Mehrdad_POOLADI\" -> \"Defender\")[relation=\"plays_position\"], (\"KIM_Younggwon\" -> \"5\")[relation=\"wears_number\"], (\"Diego_REYES\" -> \"Portugal\")[relation=\"plays_for_country\"], (\"Steven_BEITASHOUR\" -> \"Canada\")[relation=\"plays_for_country\"], (\"Johnny_ACOSTA\" -> \"Defender\")[relation=\"plays_position\"], (\"Amirhossein_SADEGHI\" -> \"Defender\")[relation=\"plays_position\"], (\"YUN_Sukyoung\" -> \"3\")[relation=\"wears_number\"], (\"Steve_VON_BERGEN\" -> \"BSC_Young_Boys\")[relation=\"plays_in_club\"], (\"Portugal\" -> \"EDER\")[relation=\"plays_for_country_inverse\"], (\"Godfrey_OBOABONA\" -> \"14\")[relation=\"wears_number\"]];\\n}\\n```\\nTask definition: given a question and factual knowledge graph, find an entity and a reasoning path in the graph to answer the question.\\nQ: what is the nationality of Diego_REYES ? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"football-worldcup-knowledge-base\"] {\\n    entity_list = [\\'Johnny_ACOSTA\\', \\'Azubuike_EGWUEKWE\\', \\'Club_America\\', \\'Defender\\', \\'WILLIAM\\', \\'Ezequiel_GARAY\\', \\'5\\', \\'Francisco_RODRIGUEZ\\', \\'14\\', \\'Godfrey_OBOABONA\\', \\'YUN_Sukyoung\\', \\'Alireza_HAGHIGHI\\', \\'BSC_Young_Boys\\', \\'LUIS_NETO\\', \\'Joel_VELTMAN\\', \\'Cristian_ZAPATA\\', \\'Stephan_LICHTSTEINER\\', \\'Steve_VON_BERGEN\\', \\'Canada\\', \\'Mehrdad_POOLADI\\', \\'Paul_AGUILAR\\', \\'2\\', \\'Oscar_BAGUI\\', \\'Amirhossein_SADEGHI\\', \\'EDER\\', \\'Arthur_BOKA\\', \\'3\\', \\'VfB_Stuttgart\\', \\'18\\', \\'Jerome_BOATENG\\', \\'Jose_CHOLEVAS\\', \\'SL_Benfica\\', \\'KIM_Younggwon\\', \\'Greece\\', \\'Diego_REYES\\', \\'Jackson_MARTINEZ\\', \\'Netherlands\\', \\'Portugal\\', \\'25\\', \\'Steven_BEITASHOUR\\', \\'Constant_DJAKPA\\', \\'6\\'];\\n    triple_list = [(\"LUIS_NETO\" -> \"Defender\")[relation=\"plays_position\"], (\"Arthur_BOKA\" -> \"VfB_Stuttgart\")[relation=\"plays_in_club\"], (\"Jose_CHOLEVAS\" -> \"Greece\")[relation=\"plays_for_country\"], (\"Portugal\" -> \"WILLIAM\")[relation=\"plays_for_country_inverse\"], (\"Constant_DJAKPA\" -> \"18\")[relation=\"wears_number\"], (\"Paul_AGUILAR\" -> \"Defender\")[relation=\"plays_position\"], (\"Stephan_LICHTSTEINER\" -> \"2\")[relation=\"wears_number\"], (\"Portugal\" -> \"Alireza_HAGHIGHI\")[relation=\"plays_for_country_inverse\"], (\"Jerome_BOATENG\" -> \"25\")[relation=\"is_aged\"], (\"Azubuike_EGWUEKWE\" -> \"6\")[relation=\"wears_number\"], (\"Portugal\" -> \"Jackson_MARTINEZ\")[relation=\"plays_for_country_inverse\"], (\"Francisco_RODRIGUEZ\" -> \"Club_America\")[relation=\"plays_in_club\"], (\"Ezequiel_GARAY\" -> \"SL_Benfica\")[relation=\"plays_in_club\"], (\"Oscar_BAGUI\" -> \"Defender\")[relation=\"plays_position\"], (\"Joel_VELTMAN\" -> \"Netherlands\")[relation=\"plays_for_country\"], (\"Cristian_ZAPATA\" -> \"2\")[relation=\"wears_number\"], (\"Mehrdad_POOLADI\" -> \"Defender\")[relation=\"plays_position\"], (\"KIM_Younggwon\" -> \"5\")[relation=\"wears_number\"], (\"Diego_REYES\" -> \"Portugal\")[relation=\"plays_for_country\"], (\"Steven_BEITASHOUR\" -> \"Canada\")[relation=\"plays_for_country\"], (\"Johnny_ACOSTA\" -> \"Defender\")[relation=\"plays_position\"], (\"Amirhossein_SADEGHI\" -> \"Defender\")[relation=\"plays_position\"], (\"YUN_Sukyoung\" -> \"3\")[relation=\"wears_number\"], (\"Steve_VON_BERGEN\" -> \"BSC_Young_Boys\")[relation=\"plays_in_club\"], (\"Portugal\" -> \"EDER\")[relation=\"plays_for_country_inverse\"], (\"Godfrey_OBOABONA\" -> \"14\")[relation=\"wears_number\"]];\\n}\\n```', 'graph': {'node_list': ['Johnny_ACOSTA', 'Azubuike_EGWUEKWE', 'Club_America', 'Defender', 'WILLIAM', 'Ezequiel_GARAY', '5', 'Francisco_RODRIGUEZ', '14', 'Godfrey_OBOABONA', 'YUN_Sukyoung', 'Alireza_HAGHIGHI', 'BSC_Young_Boys', 'LUIS_NETO', 'Joel_VELTMAN', 'Cristian_ZAPATA', 'Stephan_LICHTSTEINER', 'Steve_VON_BERGEN', 'Canada', 'Mehrdad_POOLADI', 'Paul_AGUILAR', '2', 'Oscar_BAGUI', 'Amirhossein_SADEGHI', 'EDER', 'Arthur_BOKA', '3', 'VfB_Stuttgart', '18', 'Jerome_BOATENG', 'Jose_CHOLEVAS', 'SL_Benfica', 'KIM_Younggwon', 'Greece', 'Diego_REYES', 'Jackson_MARTINEZ', 'Netherlands', 'Portugal', '25', 'Steven_BEITASHOUR', 'Constant_DJAKPA', '6'], 'edge_list': [('LUIS_NETO', 'plays_position', 'Defender'), ('Arthur_BOKA', 'plays_in_club', 'VfB_Stuttgart'), ('Jose_CHOLEVAS', 'plays_for_country', 'Greece'), ('Portugal', 'plays_for_country_inverse', 'WILLIAM'), ('Constant_DJAKPA', 'wears_number', '18'), ('Paul_AGUILAR', 'plays_position', 'Defender'), ('Stephan_LICHTSTEINER', 'wears_number', '2'), ('Portugal', 'plays_for_country_inverse', 'Alireza_HAGHIGHI'), ('Jerome_BOATENG', 'is_aged', '25'), ('Azubuike_EGWUEKWE', 'wears_number', '6'), ('Portugal', 'plays_for_country_inverse', 'Jackson_MARTINEZ'), ('Francisco_RODRIGUEZ', 'plays_in_club', 'Club_America'), ('Ezequiel_GARAY', 'plays_in_club', 'SL_Benfica'), ('Oscar_BAGUI', 'plays_position', 'Defender'), ('Joel_VELTMAN', 'plays_for_country', 'Netherlands'), ('Cristian_ZAPATA', 'wears_number', '2'), ('Mehrdad_POOLADI', 'plays_position', 'Defender'), ('KIM_Younggwon', 'wears_number', '5'), ('Diego_REYES', 'plays_for_country', 'Portugal'), ('Steven_BEITASHOUR', 'plays_for_country', 'Canada'), ('Johnny_ACOSTA', 'plays_position', 'Defender'), ('Amirhossein_SADEGHI', 'plays_position', 'Defender'), ('YUN_Sukyoung', 'wears_number', '3'), ('Steve_VON_BERGEN', 'plays_in_club', 'BSC_Young_Boys'), ('Portugal', 'plays_for_country_inverse', 'EDER'), ('Godfrey_OBOABONA', 'wears_number', '14')]}, 'answer': ['Portugal'], 'answer_with_cot': ['To find the nationality of Diego_REYES, we need to follow the reasoning path in the given graph. \\n\\n1. Find the node \"Diego_REYES\" in the entity_list. \\n2. Look for outgoing edges from \"Diego_REYES\" in the triple_list. \\n   - There is an edge (\"Diego_REYES\" -> \"Portugal\") with the relation \"plays_for_country\". \\n3. Follow the edge to the node \"Portugal\". \\n4. Now, we need to find the incoming edges to \"Portugal\" to determine the nationality of Diego_REYES. \\n   - There is an edge (\"Portugal\" -> \"WILLIAM\") with the relation \"plays_for_country_inverse\". \\n5. Follow the edge to the node \"WILLIAM\". \\n6. \"WILLIAM\" represents the nationality of Diego_REYES. \\n\\nTherefore, the nationality of Diego_REYES is \"WILLIAM\".', \"[('Diego_REYES', 'plays_for_country', 'Portugal')]\"], 'difficulty': 'simple', 'from': 'WC2014'},\n",
       "       {'task_name': 'graph-structure-modeling-graph-degree-computing-nlgraph', 'idx': 496, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"degree-computing\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];\\n    edge_list = [(0 <-> 4), (0 <-> 11), (0 <-> 5), (0 <-> 9), (0 <-> 6), (1 <-> 2), (1 <-> 7), (1 <-> 3), (1 <-> 10), (1 <-> 8), (2 <-> 7), (2 <-> 3), (2 <-> 10), (2 <-> 8), (3 <-> 7), (3 <-> 10), (3 <-> 8), (4 <-> 11), (4 <-> 5), (4 <-> 9), (4 <-> 6), (5 <-> 11), (5 <-> 9), (5 <-> 6), (6 <-> 11), (6 <-> 9), (7 <-> 10), (7 <-> 8), (8 <-> 10), (9 <-> 11)];\\n    target_node = 9;\\n}```\\nTask definition: calculate the degree of the target node in the graph.\\nQ: What\\'s the degree of the target node? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"degree-computing\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];\\n    edge_list = [(0 <-> 4), (0 <-> 11), (0 <-> 5), (0 <-> 9), (0 <-> 6), (1 <-> 2), (1 <-> 7), (1 <-> 3), (1 <-> 10), (1 <-> 8), (2 <-> 7), (2 <-> 3), (2 <-> 10), (2 <-> 8), (3 <-> 7), (3 <-> 10), (3 <-> 8), (4 <-> 11), (4 <-> 5), (4 <-> 9), (4 <-> 6), (5 <-> 11), (5 <-> 9), (5 <-> 6), (6 <-> 11), (6 <-> 9), (7 <-> 10), (7 <-> 8), (8 <-> 10), (9 <-> 11)];\\n    target_node = 9;\\n}```', 'graph': {'node_list': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], 'edge_list': [('0', '4'), ('0', '11'), ('0', '5'), ('0', '9'), ('0', '6'), ('1', '2'), ('1', '7'), ('1', '3'), ('1', '10'), ('1', '8'), ('2', '7'), ('2', '3'), ('2', '10'), ('2', '8'), ('3', '7'), ('3', '10'), ('3', '8'), ('4', '11'), ('4', '5'), ('4', '9'), ('4', '6'), ('5', '11'), ('5', '9'), ('5', '6'), ('6', '11'), ('6', '9'), ('7', '10'), ('7', '8'), ('8', '10'), ('9', '11')], 'target_node': 9}, 'answer': ['The degree of the target node 9 is 5'], 'answer_with_cot': ['To calculate the degree of a node in a graph, we need to count the number of edges connected to that node.\\n\\nIn the given graph, the target node is node 9. We can see from the edge_list that node 9 is connected to nodes 0, 4, 5, and 6. Since the edges are undirected, these connections can be counted twice (once from the perspective of node 9 and once from the perspective of the connected nodes).\\n\\nTherefore, the degree of the target node (node 9) is 4.'], 'difficulty': 'easy', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-language-modeling-graph-question-answering-wc2014', 'idx': 864, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"football-worldcup-knowledge-base\"] {\\n    entity_list = [\\'Arsenal_FC\\', \\'Bacary_SAGNA\\', \\'Cesar_AZPILICUETA\\', \\'Christian_BOLANOS\\', \\'Simon_MIGNOLET\\', \\'Jean_BEAUSEJOUR\\', \\'England\\', \\'Marouane_FELLAINI\\', \\'Defender\\', \\'Luke_SHAW\\', \\'Gary_MEDEL\\', \\'Gary_CAHILL\\', \\'David_SILVA\\', \\'Alex_OXLADE_CHAMBERLAIN\\', \\'Tim_KRUL\\', \\'Mathis_BOLLY\\', \\'8\\', \\'Pablo_ARMERO\\', \\'Chelsea_FC\\', \\'Liverpool_FC\\', \\'Manchester_City_FC\\', \\'Watford_FC\\', \\'Antonio_CANDREVA\\', \\'Oscar_BAGUI\\', \\'Hull_City_FC\\', \\'9\\', \\'Alvaro_GONZALEZ\\', \\'Samuel_ETOO\\', \\'Maynor_FIGUEROA\\', \\'Midfielder\\', \\'Wigan_Athletic_FC\\', \\'Kyle_BECKERMAN\\', \\'Norwich_City_FC\\', \\'Goalkeeper\\', \\'Manchester_United_FC\\', \\'Phil_JAGIELKA\\', \\'Jonathan_DE_GUZMAN\\', \\'Joseph_YOBO\\'];\\n    triple_list = [(\"Bacary_SAGNA\" -> \"Arsenal_FC\")[relation=\"plays_in_club\"], (\"Simon_MIGNOLET\" -> \"Goalkeeper\")[relation=\"plays_position\"], (\"Tim_KRUL\" -> \"Goalkeeper\")[relation=\"plays_position\"], (\"England\" -> \"Luke_SHAW\")[relation=\"plays_for_country_inverse\"], (\"Gary_CAHILL\" -> \"Chelsea_FC\")[relation=\"plays_in_club\"], (\"Midfielder\" -> \"Antonio_CANDREVA\")[relation=\"plays_position_inverse\"], (\"Manchester_United_FC\" -> \"Marouane_FELLAINI\")[relation=\"plays_in_club_inverse\"], (\"Midfielder\" -> \"Alex_OXLADE_CHAMBERLAIN\")[relation=\"plays_position_inverse\"], (\"Norwich_City_FC\" -> \"Joseph_YOBO\")[relation=\"plays_in_club_inverse\"], (\"Cesar_AZPILICUETA\" -> \"England\")[relation=\"plays_for_country\"], (\"David_SILVA\" -> \"Manchester_City_FC\")[relation=\"plays_in_club\"], (\"England\" -> \"Watford_FC\")[relation=\"is_in_country_inverse\"], (\"Hull_City_FC\" -> \"Maynor_FIGUEROA\")[relation=\"plays_in_club_inverse\"], (\"Jean_BEAUSEJOUR\" -> \"Wigan_Athletic_FC\")[relation=\"plays_in_club\"], (\"Cesar_AZPILICUETA\" -> \"Midfielder\")[relation=\"plays_position\"], (\"Midfielder\" -> \"Mathis_BOLLY\")[relation=\"plays_position_inverse\"], (\"Jonathan_DE_GUZMAN\" -> \"8\")[relation=\"wears_number\"], (\"Midfielder\" -> \"Alvaro_GONZALEZ\")[relation=\"plays_position_inverse\"], (\"Simon_MIGNOLET\" -> \"Liverpool_FC\")[relation=\"plays_in_club\"], (\"Phil_JAGIELKA\" -> \"England\")[relation=\"plays_for_country\"], (\"Defender\" -> \"Pablo_ARMERO\")[relation=\"plays_position_inverse\"], (\"Gary_MEDEL\" -> \"England\")[relation=\"plays_for_country\"], (\"Midfielder\" -> \"Kyle_BECKERMAN\")[relation=\"plays_position_inverse\"], (\"Samuel_ETOO\" -> \"9\")[relation=\"wears_number\"], (\"Defender\" -> \"Oscar_BAGUI\")[relation=\"plays_position_inverse\"], (\"Midfielder\" -> \"Christian_BOLANOS\")[relation=\"plays_position_inverse\"]];\\n}\\n```\\nTask definition: given a question and factual knowledge graph, find an entity and a reasoning path in the graph to answer the question.\\nQ: who plays for the England national football team ? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"football-worldcup-knowledge-base\"] {\\n    entity_list = [\\'Arsenal_FC\\', \\'Bacary_SAGNA\\', \\'Cesar_AZPILICUETA\\', \\'Christian_BOLANOS\\', \\'Simon_MIGNOLET\\', \\'Jean_BEAUSEJOUR\\', \\'England\\', \\'Marouane_FELLAINI\\', \\'Defender\\', \\'Luke_SHAW\\', \\'Gary_MEDEL\\', \\'Gary_CAHILL\\', \\'David_SILVA\\', \\'Alex_OXLADE_CHAMBERLAIN\\', \\'Tim_KRUL\\', \\'Mathis_BOLLY\\', \\'8\\', \\'Pablo_ARMERO\\', \\'Chelsea_FC\\', \\'Liverpool_FC\\', \\'Manchester_City_FC\\', \\'Watford_FC\\', \\'Antonio_CANDREVA\\', \\'Oscar_BAGUI\\', \\'Hull_City_FC\\', \\'9\\', \\'Alvaro_GONZALEZ\\', \\'Samuel_ETOO\\', \\'Maynor_FIGUEROA\\', \\'Midfielder\\', \\'Wigan_Athletic_FC\\', \\'Kyle_BECKERMAN\\', \\'Norwich_City_FC\\', \\'Goalkeeper\\', \\'Manchester_United_FC\\', \\'Phil_JAGIELKA\\', \\'Jonathan_DE_GUZMAN\\', \\'Joseph_YOBO\\'];\\n    triple_list = [(\"Bacary_SAGNA\" -> \"Arsenal_FC\")[relation=\"plays_in_club\"], (\"Simon_MIGNOLET\" -> \"Goalkeeper\")[relation=\"plays_position\"], (\"Tim_KRUL\" -> \"Goalkeeper\")[relation=\"plays_position\"], (\"England\" -> \"Luke_SHAW\")[relation=\"plays_for_country_inverse\"], (\"Gary_CAHILL\" -> \"Chelsea_FC\")[relation=\"plays_in_club\"], (\"Midfielder\" -> \"Antonio_CANDREVA\")[relation=\"plays_position_inverse\"], (\"Manchester_United_FC\" -> \"Marouane_FELLAINI\")[relation=\"plays_in_club_inverse\"], (\"Midfielder\" -> \"Alex_OXLADE_CHAMBERLAIN\")[relation=\"plays_position_inverse\"], (\"Norwich_City_FC\" -> \"Joseph_YOBO\")[relation=\"plays_in_club_inverse\"], (\"Cesar_AZPILICUETA\" -> \"England\")[relation=\"plays_for_country\"], (\"David_SILVA\" -> \"Manchester_City_FC\")[relation=\"plays_in_club\"], (\"England\" -> \"Watford_FC\")[relation=\"is_in_country_inverse\"], (\"Hull_City_FC\" -> \"Maynor_FIGUEROA\")[relation=\"plays_in_club_inverse\"], (\"Jean_BEAUSEJOUR\" -> \"Wigan_Athletic_FC\")[relation=\"plays_in_club\"], (\"Cesar_AZPILICUETA\" -> \"Midfielder\")[relation=\"plays_position\"], (\"Midfielder\" -> \"Mathis_BOLLY\")[relation=\"plays_position_inverse\"], (\"Jonathan_DE_GUZMAN\" -> \"8\")[relation=\"wears_number\"], (\"Midfielder\" -> \"Alvaro_GONZALEZ\")[relation=\"plays_position_inverse\"], (\"Simon_MIGNOLET\" -> \"Liverpool_FC\")[relation=\"plays_in_club\"], (\"Phil_JAGIELKA\" -> \"England\")[relation=\"plays_for_country\"], (\"Defender\" -> \"Pablo_ARMERO\")[relation=\"plays_position_inverse\"], (\"Gary_MEDEL\" -> \"England\")[relation=\"plays_for_country\"], (\"Midfielder\" -> \"Kyle_BECKERMAN\")[relation=\"plays_position_inverse\"], (\"Samuel_ETOO\" -> \"9\")[relation=\"wears_number\"], (\"Defender\" -> \"Oscar_BAGUI\")[relation=\"plays_position_inverse\"], (\"Midfielder\" -> \"Christian_BOLANOS\")[relation=\"plays_position_inverse\"]];\\n}\\n```', 'graph': {'node_list': ['Arsenal_FC', 'Bacary_SAGNA', 'Cesar_AZPILICUETA', 'Christian_BOLANOS', 'Simon_MIGNOLET', 'Jean_BEAUSEJOUR', 'England', 'Marouane_FELLAINI', 'Defender', 'Luke_SHAW', 'Gary_MEDEL', 'Gary_CAHILL', 'David_SILVA', 'Alex_OXLADE_CHAMBERLAIN', 'Tim_KRUL', 'Mathis_BOLLY', '8', 'Pablo_ARMERO', 'Chelsea_FC', 'Liverpool_FC', 'Manchester_City_FC', 'Watford_FC', 'Antonio_CANDREVA', 'Oscar_BAGUI', 'Hull_City_FC', '9', 'Alvaro_GONZALEZ', 'Samuel_ETOO', 'Maynor_FIGUEROA', 'Midfielder', 'Wigan_Athletic_FC', 'Kyle_BECKERMAN', 'Norwich_City_FC', 'Goalkeeper', 'Manchester_United_FC', 'Phil_JAGIELKA', 'Jonathan_DE_GUZMAN', 'Joseph_YOBO'], 'edge_list': [('Bacary_SAGNA', 'plays_in_club', 'Arsenal_FC'), ('Simon_MIGNOLET', 'plays_position', 'Goalkeeper'), ('Tim_KRUL', 'plays_position', 'Goalkeeper'), ('England', 'plays_for_country_inverse', 'Luke_SHAW'), ('Gary_CAHILL', 'plays_in_club', 'Chelsea_FC'), ('Midfielder', 'plays_position_inverse', 'Antonio_CANDREVA'), ('Manchester_United_FC', 'plays_in_club_inverse', 'Marouane_FELLAINI'), ('Midfielder', 'plays_position_inverse', 'Alex_OXLADE_CHAMBERLAIN'), ('Norwich_City_FC', 'plays_in_club_inverse', 'Joseph_YOBO'), ('Cesar_AZPILICUETA', 'plays_for_country', 'England'), ('David_SILVA', 'plays_in_club', 'Manchester_City_FC'), ('England', 'is_in_country_inverse', 'Watford_FC'), ('Hull_City_FC', 'plays_in_club_inverse', 'Maynor_FIGUEROA'), ('Jean_BEAUSEJOUR', 'plays_in_club', 'Wigan_Athletic_FC'), ('Cesar_AZPILICUETA', 'plays_position', 'Midfielder'), ('Midfielder', 'plays_position_inverse', 'Mathis_BOLLY'), ('Jonathan_DE_GUZMAN', 'wears_number', '8'), ('Midfielder', 'plays_position_inverse', 'Alvaro_GONZALEZ'), ('Simon_MIGNOLET', 'plays_in_club', 'Liverpool_FC'), ('Phil_JAGIELKA', 'plays_for_country', 'England'), ('Defender', 'plays_position_inverse', 'Pablo_ARMERO'), ('Gary_MEDEL', 'plays_for_country', 'England'), ('Midfielder', 'plays_position_inverse', 'Kyle_BECKERMAN'), ('Samuel_ETOO', 'wears_number', '9'), ('Defender', 'plays_position_inverse', 'Oscar_BAGUI'), ('Midfielder', 'plays_position_inverse', 'Christian_BOLANOS')]}, 'answer': ['Luke_SHAW'], 'answer_with_cot': ['To answer the question \"who plays for the England national football team?\" using the given knowledge graph, we need to find the entity/entities that are connected to \"England\" with the relation \"plays_for_country\". \\n\\nBy analyzing the graph, we can follow the reasoning path as follows:\\n\\n1. Start with the node \"England\".\\n2. Look for outgoing edges with the relation \"plays_for_country_reverse\".\\n\\n   - We find an outgoing edge from \"England\" with the relation \"plays_for_country_reverse\" to \"Luke_SHAW\".\\n   \\n3. The entity \"Luke_SHAW\" plays for the England national football team.\\n\\nSo, the entity \"Luke_SHAW\" plays for the England national football team.', \"[('England', 'plays_for_country_inverse', 'Luke_SHAW')]\"], 'difficulty': 'simple', 'from': 'WC2014'},\n",
       "       {'task_name': 'graph-structure-modeling-graph-cycle-detection-nlgraph', 'idx': 721, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"cycle-detection\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31];\\n    edge_list = [(18 <-> 24), (5 <-> 7), (19 <-> 28), (9 <-> 3), (23 <-> 10), (12 <-> 6), (4 <-> 26), (5 <-> 26), (23 <-> 0), (23 <-> 4), (27 <-> 23), (18 <-> 15), (27 <-> 17), (4 <-> 22), (2 <-> 8), (24 <-> 16), (0 <-> 29), (21 <-> 9), (14 <-> 1), (20 <-> 31), (18 <-> 23), (2 <-> 13), (0 <-> 30), (11 <-> 28), (20 <-> 1), (29 <-> 6), (3 <-> 5), (13 <-> 26), (28 <-> 2), (27 <-> 25), (4 <-> 14)];\\n}\\n```\\nTask definition: determine if there is a cycle in this graph.\\nQ: Is there a cycle in this graph? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"cycle-detection\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31];\\n    edge_list = [(18 <-> 24), (5 <-> 7), (19 <-> 28), (9 <-> 3), (23 <-> 10), (12 <-> 6), (4 <-> 26), (5 <-> 26), (23 <-> 0), (23 <-> 4), (27 <-> 23), (18 <-> 15), (27 <-> 17), (4 <-> 22), (2 <-> 8), (24 <-> 16), (0 <-> 29), (21 <-> 9), (14 <-> 1), (20 <-> 31), (18 <-> 23), (2 <-> 13), (0 <-> 30), (11 <-> 28), (20 <-> 1), (29 <-> 6), (3 <-> 5), (13 <-> 26), (28 <-> 2), (27 <-> 25), (4 <-> 14)];\\n}\\n```', 'graph': {'node_list': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31], 'edge_list': [('18', '24'), ('5', '7'), ('19', '28'), ('9', '3'), ('23', '10'), ('12', '6'), ('4', '26'), ('5', '26'), ('23', '0'), ('23', '4'), ('27', '23'), ('18', '15'), ('27', '17'), ('4', '22'), ('2', '8'), ('24', '16'), ('0', '29'), ('21', '9'), ('14', '1'), ('20', '31'), ('18', '23'), ('2', '13'), ('0', '30'), ('11', '28'), ('20', '1'), ('29', '6'), ('3', '5'), ('13', '26'), ('28', '2'), ('27', '25'), ('4', '14')]}, 'answer': ['No, there is no cycle in this graph.'], 'answer_with_cot': [\"To determine if there is a cycle in this graph, we can use a graph traversal algorithm such as Depth First Search (DFS). Starting from any node, we can follow the edges and keep track of visited nodes. If we encounter a node that has already been visited, then there is a cycle in the graph.\\n\\nLet's perform a DFS traversal on the given graph:\\n\\nStarting from node 0:\\n- Visit node 0.\\n- Visit node 29.\\n- Visit node 6.\\n- Visit node 12.\\n- Visit node 4.\\n- Visit node 14.\\n- Visit node 1.\\n- Visit node 20.\\n- Visit node 31.\\n- Visit node 20 (already visited, cycle detected).\\n\\nTherefore, there is a cycle in this graph.\"], 'difficulty': 'hard', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-wikidata5m', 'idx': 11383, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'Taxxon\\', \\'Critoniopsis sevillana\\', \\'critoniopsis\\', \\'concept\\', \\'Books/Organism\\', \\'VU\\', \\'cohesion species\\', \\'cladex/testcases\\'];\\n    triple_list = [(\"Critoniopsis sevillana\" -> \"VU\")[relation=\"IUCN conservation status\"], (\"Critoniopsis sevillana\" -> \"critoniopsis\")[relation=\"parent taxon\"], (\"Critoniopsis sevillana\" -> \"cohesion species\")[relation=\"taxon rank\"], (\"Taxxon\" -> \"concept\")[relation=\"subclass of\"], (\"Taxxon\" -> \"Books/Organism\")[relation=\"has part\"], (\"Taxxon\" -> \"cladex/testcases\")[relation=\"different from\"]];;\\n    head_entity = \"Taxxon\";\\n    tail_entity = \"cladex/testcases\";\\n}\\n```\\nTask definition: given one head entity and tail entity and corresponding one-hop knowledge sub-graph, classify the relation between head entity and tail entity into one of \"CPU\", \"regulates (molecular biology)\", \"taxon rank\", \"subclass of\", \"has part\", \"game mechanics\", \"instance of\", \"parent taxon\", \"different from\", \"IUCN conservation status\", \"list of monuments\", \"regulated by\", \"lyrics by\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'Taxxon\\', \\'Critoniopsis sevillana\\', \\'critoniopsis\\', \\'concept\\', \\'Books/Organism\\', \\'VU\\', \\'cohesion species\\', \\'cladex/testcases\\'];\\n    triple_list = [(\"Critoniopsis sevillana\" -> \"VU\")[relation=\"IUCN conservation status\"], (\"Critoniopsis sevillana\" -> \"critoniopsis\")[relation=\"parent taxon\"], (\"Critoniopsis sevillana\" -> \"cohesion species\")[relation=\"taxon rank\"], (\"Taxxon\" -> \"concept\")[relation=\"subclass of\"], (\"Taxxon\" -> \"Books/Organism\")[relation=\"has part\"], (\"Taxxon\" -> \"cladex/testcases\")[relation=\"different from\"]];;\\n    head_entity = \"Taxxon\";\\n    tail_entity = \"cladex/testcases\";\\n}\\n```', 'graph': {'node_list': ['Taxxon', 'Critoniopsis sevillana', 'critoniopsis', 'concept', 'Books/Organism', 'VU', 'cohesion species', 'cladex/testcases'], 'edge_list': [('Critoniopsis sevillana', 'IUCN conservation status', 'VU'), ('Critoniopsis sevillana', 'parent taxon', 'critoniopsis'), ('Critoniopsis sevillana', 'taxon rank', 'cohesion species'), ('Taxxon', 'subclass of', 'concept'), ('Taxxon', 'has part', 'Books/Organism'), ('Taxxon', 'different from', 'cladex/testcases')]}, 'answer': ['instance of'], 'answer_with_cot': ['To classify the relation between the head entity \"Taxxon\" and the tail entity \"cladex/testcases,\" we need to examine the provided knowledge sub-graph.\\n\\nLooking at the triple list in the graph language, we can identify the following connections:\\n\\n1. (\"Taxxon\" -> \"cladex/testcases\")[relation=\"different from\"]\\n\\nBased on this connection, we can classify the relation between \"Taxxon\" and \"cladex/testcases\" as \"different from.\"\\n\\nTherefore, the relation between the head entity \"Taxxon\" and the tail entity \"cladex/testcases\" is \"different from.\"'], 'difficulty': 'medium', 'from': 'Wikidata5M'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-wikidata5m', 'idx': 18695, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'malaysian federation\\', \\'hussein shah of johor\\', \\'Malacca City, Malacca\\', \\'Tengku Alam Shah\\', \\'Sunnis\\', \\'Sultan Ali Iskandar Shah\\', \\'cingkappur kudiyaracu\\', \\'Huamn\\', \\'Sultan of Johor\\'];\\n    triple_list = [(\"hussein shah of johor\" -> \"Huamn\")[relation=\"instance of\"], (\"hussein shah of johor\" -> \"Malacca City, Malacca\")[relation=\"place of death\"], (\"hussein shah of johor\" -> \"malaysian federation\")[relation=\"country of citizenship\"], (\"hussein shah of johor\" -> \"Sunnis\")[relation=\"religion\"], (\"hussein shah of johor\" -> \"Sultan of Johor\")[relation=\"position held\"], (\"Sultan Ali Iskandar Shah\" -> \"Sunnis\")[relation=\"religion\"], (\"Sultan Ali Iskandar Shah\" -> \"Sultan of Johor\")[relation=\"position held\"], (\"Sultan Ali Iskandar Shah\" -> \"Tengku Alam Shah\")[relation=\"child\"], (\"Sultan Ali Iskandar Shah\" -> \"Huamn\")[relation=\"instance of\"], (\"Sultan Ali Iskandar Shah\" -> \"malaysian federation\")[relation=\"country of citizenship\"], (\"Sultan Ali Iskandar Shah\" -> \"cingkappur kudiyaracu\")[relation=\"place of birth\"]];;\\n    head_entity = \"Sultan Ali Iskandar Shah\";\\n    tail_entity = \"cingkappur kudiyaracu\";\\n}\\n```\\nTask definition: given one head entity and tail entity and corresponding one-hop knowledge sub-graph, classify the relation between head entity and tail entity into one of \"decay mode\", \"sitter\", \"place of birth\", \"location of formation\", \"point group\", \"religion\", \"active ingredient in\", \"place of death\", \"position held\", \"country of citizenship\", \"father\", \"instance of\", \"ancestral home\", \"child\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'malaysian federation\\', \\'hussein shah of johor\\', \\'Malacca City, Malacca\\', \\'Tengku Alam Shah\\', \\'Sunnis\\', \\'Sultan Ali Iskandar Shah\\', \\'cingkappur kudiyaracu\\', \\'Huamn\\', \\'Sultan of Johor\\'];\\n    triple_list = [(\"hussein shah of johor\" -> \"Huamn\")[relation=\"instance of\"], (\"hussein shah of johor\" -> \"Malacca City, Malacca\")[relation=\"place of death\"], (\"hussein shah of johor\" -> \"malaysian federation\")[relation=\"country of citizenship\"], (\"hussein shah of johor\" -> \"Sunnis\")[relation=\"religion\"], (\"hussein shah of johor\" -> \"Sultan of Johor\")[relation=\"position held\"], (\"Sultan Ali Iskandar Shah\" -> \"Sunnis\")[relation=\"religion\"], (\"Sultan Ali Iskandar Shah\" -> \"Sultan of Johor\")[relation=\"position held\"], (\"Sultan Ali Iskandar Shah\" -> \"Tengku Alam Shah\")[relation=\"child\"], (\"Sultan Ali Iskandar Shah\" -> \"Huamn\")[relation=\"instance of\"], (\"Sultan Ali Iskandar Shah\" -> \"malaysian federation\")[relation=\"country of citizenship\"], (\"Sultan Ali Iskandar Shah\" -> \"cingkappur kudiyaracu\")[relation=\"place of birth\"]];;\\n    head_entity = \"Sultan Ali Iskandar Shah\";\\n    tail_entity = \"cingkappur kudiyaracu\";\\n}\\n```', 'graph': {'node_list': ['malaysian federation', 'hussein shah of johor', 'Malacca City, Malacca', 'Tengku Alam Shah', 'Sunnis', 'Sultan Ali Iskandar Shah', 'cingkappur kudiyaracu', 'Huamn', 'Sultan of Johor'], 'edge_list': [('hussein shah of johor', 'instance of', 'Huamn'), ('hussein shah of johor', 'place of death', 'Malacca City, Malacca'), ('hussein shah of johor', 'country of citizenship', 'malaysian federation'), ('hussein shah of johor', 'religion', 'Sunnis'), ('hussein shah of johor', 'position held', 'Sultan of Johor'), ('Sultan Ali Iskandar Shah', 'religion', 'Sunnis'), ('Sultan Ali Iskandar Shah', 'position held', 'Sultan of Johor'), ('Sultan Ali Iskandar Shah', 'child', 'Tengku Alam Shah'), ('Sultan Ali Iskandar Shah', 'instance of', 'Huamn'), ('Sultan Ali Iskandar Shah', 'country of citizenship', 'malaysian federation'), ('Sultan Ali Iskandar Shah', 'place of birth', 'cingkappur kudiyaracu')]}, 'answer': ['child'], 'answer_with_cot': ['To classify the relation between the head entity \"Sultan Ali Iskandar Shah\" and the tail entity \"cingkappur kudiyaracu\", we can follow the steps below:\\n\\n1. Inspect the given triple_list:\\n- (\"hussein shah of johor\" -> \"Huamn\")[relation=\"instance of\"]\\n- (\"hussein shah of johor\" -> \"Malacca City, Malacca\")[relation=\"place of death\"]\\n- (\"hussein shah of johor\" -> \"malaysian federation\")[relation=\"country of citizenship\"]\\n- (\"hussein shah of johor\" -> \"Sunnis\")[relation=\"religion\"]\\n- (\"hussein shah of johor\" -> \"Sultan of Johor\")[relation=\"position held\"]\\n- (\"Sultan Ali Iskandar Shah\" -> \"Sunnis\")[relation=\"religion\"]\\n- (\"Sultan Ali Iskandar Shah\" -> \"Sultan of Johor\")[relation=\"position held\"]\\n- (\"Sultan Ali Iskandar Shah\" -> \"Tengku Alam Shah\")[relation=\"child\"]\\n- (\"Sultan Ali Iskandar Shah\" -> \"Huamn\")[relation=\"instance of\"]\\n- (\"Sultan Ali Iskandar Shah\" -> \"malaysian federation\")[relation=\"country of citizenship\"]\\n- (\"Sultan Ali Iskandar Shah\" -> \"cingkappur kudiyaracu\")[relation=\"place of birth\"]\\n\\n2. Determine if there is any triple with the head entity as the first element and the tail entity as the second element. In this case, the triple (\"Sultan Ali Iskandar Shah\" -> \"cingkappur kudiyaracu\")[relation=\"place of birth\"] fits this condition.\\n\\n3. Extract the relation from the triple. The relation in this case is \"place of birth\".\\n\\n4. Classify the relation based on the provided relation categories. In this case, the relation \"place of birth\" matches the provided category.\\n\\nTherefore, the relation between the head entity \"Sultan Ali Iskandar Shah\" and the tail entity \"cingkappur kudiyaracu\" is classified as \"place of birth\".'], 'difficulty': 'medium', 'from': 'Wikidata5M'},\n",
       "       {'task_name': 'graph-language-modeling-graph-relevance-inspection', 'idx': 5991, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikipedia-knowledge-graph\"] {\\n    entity_list = [\\'rajasthan\\', \\'bhargava\\', \\'india.\\', \\'march 2009\\', \"neta ji\\'\", \\'nearly\\', \\'consecutive\\', \\'thereafter\\', \\'11 november\\', \\'parliament\\', \\'jaipur\\', \\'constituency\\', \\'margins\\', \\'heart attack\\', \\'lok sabha\\', \\'bhawani singh\\', \"\\'scooter\", \\'member\\', \\'100,000\\', \\'house of\\', \\'janata party\\'];\\n    triple_list = [(\"rajasthan\" -> \"jaipur\")[relation=\"capital\"], (\"rajasthan\" -> \"india.\")[relation=\"country\"], (\"bhargava\" -> \"india.\")[relation=\"country of citizenship\"], (\"india.\" -> \"rajasthan\")[relation=\"contains administrative territorial entity\"], (\"jaipur\" -> \"india.\")[relation=\"country\"], (\"jaipur\" -> \"rajasthan\")[relation=\"capital of\"], (\"lok sabha\" -> \"india.\")[relation=\"country\"], (\"bhawani singh\" -> \"jaipur\")[relation=\"place of birth\"], (\"bhawani singh\" -> \"india.\")[relation=\"country of citizenship\"], (\"janata party\" -> \"india.\")[relation=\"country\"]];\\n}\\n```\\nCaption: Girdhari Lal Bhargava (11 November 1936 – 8 March 2009) was a member of the Lok Sabha (lower house of parliament) in India. A member of the Bharatiya Janata Party, he was elected six consecutive times for the Jaipur constituency of Rajasthan. He defeated Bhawani Singh by nearly 100,000 votes and thereafter had margins always above 100,000 votes. He was sometimes called \\'scooter wale neta ji\\' He died on 8 March 2009 from a heart attack while he was visiting Ahmedabad.\\nTask definition: A binary classification task to inspect whether the given caption is relevant to the graph. The classes are \"Relevant\" and \"Irrelevant\". Note that: Irrelevance means that all the information mentioned in the caption cannot be found in the graph.\\nQ: Given you a knowledge graph and a caption, please inspect whether the caption is relevant to the graph. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikipedia-knowledge-graph\"] {\\n    entity_list = [\\'rajasthan\\', \\'bhargava\\', \\'india.\\', \\'march 2009\\', \"neta ji\\'\", \\'nearly\\', \\'consecutive\\', \\'thereafter\\', \\'11 november\\', \\'parliament\\', \\'jaipur\\', \\'constituency\\', \\'margins\\', \\'heart attack\\', \\'lok sabha\\', \\'bhawani singh\\', \"\\'scooter\", \\'member\\', \\'100,000\\', \\'house of\\', \\'janata party\\'];\\n    triple_list = [(\"rajasthan\" -> \"jaipur\")[relation=\"capital\"], (\"rajasthan\" -> \"india.\")[relation=\"country\"], (\"bhargava\" -> \"india.\")[relation=\"country of citizenship\"], (\"india.\" -> \"rajasthan\")[relation=\"contains administrative territorial entity\"], (\"jaipur\" -> \"india.\")[relation=\"country\"], (\"jaipur\" -> \"rajasthan\")[relation=\"capital of\"], (\"lok sabha\" -> \"india.\")[relation=\"country\"], (\"bhawani singh\" -> \"jaipur\")[relation=\"place of birth\"], (\"bhawani singh\" -> \"india.\")[relation=\"country of citizenship\"], (\"janata party\" -> \"india.\")[relation=\"country\"]];\\n}\\n```', 'graph': {'node_list': ['rajasthan', 'bhargava', 'india.', 'march 2009', \"neta ji'\", 'nearly', 'consecutive', 'thereafter', '11 november', 'parliament', 'jaipur', 'constituency', 'margins', 'heart attack', 'lok sabha', 'bhawani singh', \"'scooter\", 'member', '100,000', 'house of', 'janata party'], 'edge_list': [['rajasthan', 'capital', 'jaipur'], ['rajasthan', 'country', 'india.'], ['bhargava', 'country of citizenship', 'india.'], ['india.', 'contains administrative territorial entity', 'rajasthan'], ['jaipur', 'country', 'india.'], ['jaipur', 'capital of', 'rajasthan'], ['lok sabha', 'country', 'india.'], ['bhawani singh', 'place of birth', 'jaipur'], ['bhawani singh', 'country of citizenship', 'india.'], ['janata party', 'country', 'india.']]}, 'answer': ['Relevant'], 'answer_with_cot': ['To determine if the caption is relevant to the graph, we need to check if all the information mentioned in the caption can be found in the graph.\\n\\nStep 1: Extract the relevant information from the caption:\\n- Girdhari Lal Bhargava was a member of the Lok Sabha in India.\\n- He was a member of the Bharatiya Janata Party.\\n- He was elected six consecutive times for the Jaipur constituency of Rajasthan.\\n- He defeated Bhawani Singh by nearly 100,000 votes.\\n- He died on 8 March 2009 from a heart attack while visiting Ahmedabad.\\n\\nStep 2: Check if the extracted information can be found in the graph:\\n\\n1. Girdhari Lal Bhargava being a member of the Lok Sabha in India.\\nCheck if there is a node representing Girdhari Lal Bhargava and if there is a directed edge from Girdhari Lal Bhargava to a node representing the Lok Sabha, and another directed edge from Girdhari Lal Bhargava to a node representing India.\\n\\n2. Girdhari Lal Bhargava being a member of the Bharatiya Janata Party.\\nCheck if there is a node representing Girdhari Lal Bhargava and if there is a directed edge from Girdhari Lal Bhargava to a node representing the Bharatiya Janata Party.\\n\\n3. Girdhari Lal Bhargava being elected six consecutive times for the Jaipur constituency of Rajasthan.\\nCheck if there is a node representing Girdhari Lal Bhargava and if there is a directed edge from Girdhari Lal Bhargava to a node representing the Jaipur constituency, and another directed edge from the Jaipur constituency node to a node representing Rajasthan.\\n\\n4. Girdhari Lal Bhargava defeating Bhawani Singh by nearly 100,000 votes.\\nCheck if there are nodes representing Girdhari Lal Bhargava and Bhawani Singh, and if there is a directed edge from Bhawani Singh to Girdhari Lal Bhargava representing the defeat.\\n\\n5. Girdhari Lal Bhargava dying on 8 March 2009 from a heart attack while visiting Ahmedabad.\\nCheck if there is a node representing Girdhari Lal Bhargava and if there is a directed edge from Girdhari Lal Bhargava to a node representing Ahmedabad, with an attribute indicating the cause of death as a heart attack.\\n\\nIf all the above checks pass, then the caption is relevant to the graph. Otherwise, it is considered irrelevant.'], 'difficulty': 'simple', 'from': 'GraphCaptionGeneration'},\n",
       "       {'task_name': 'graph-structure-modeling-bipartite-graph-matching-nlgraph', 'idx': 107, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i -> j) means that the applicant i is interested in the job j.\\n```\\nGraph[name=\"job-interest\"] {\\n    applicant_list = [0, 1, 2, 3, 4, 5];\\n    job_list = [6, 7, 8, 9, 10, 11, 12];\\n    interest_mapping_list = [(0 -> 10), (0 -> 7), (0 -> 11), (0 -> 12), (1 -> 12), (1 -> 7), (2 -> 9), (2 -> 7), (3 -> 6), (3 -> 9), (3 -> 10), (4 -> 7), (4 -> 12), (4 -> 8), (5 -> 8)];\\n}\\n```\\nTask definition: based on a job interest graph, to assign a job for each applicant that they are interested in. Each applicant is interested in some of the jobs. Each job can only accept one applicant and a job applicant can be appointed for only one job.\\nQ: Find an assignment of jobs to applicants in such that the maximum number of applicants find the job they are interested in. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"job-interest\"] {\\n    applicant_list = [0, 1, 2, 3, 4, 5];\\n    job_list = [6, 7, 8, 9, 10, 11, 12];\\n    interest_mapping_list = [(0 -> 10), (0 -> 7), (0 -> 11), (0 -> 12), (1 -> 12), (1 -> 7), (2 -> 9), (2 -> 7), (3 -> 6), (3 -> 9), (3 -> 10), (4 -> 7), (4 -> 12), (4 -> 8), (5 -> 8)];\\n}\\n```', 'graph': {'node_list': {'user_node_list': [0, 1, 2, 3, 4, 5], 'item_node_list': [6, 7, 8, 9, 10, 11, 12]}, 'edge_list': [('0', '10'), ('0', '7'), ('0', '11'), ('0', '12'), ('1', '12'), ('1', '7'), ('2', '9'), ('2', '7'), ('3', '6'), ('3', '9'), ('3', '10'), ('4', '7'), ('4', '12'), ('4', '8'), ('5', '8')]}, 'answer': ['applicant 0: job 10\\napplicant 1: job 12\\napplicant 2: job 9\\napplicant 3: job 6\\napplicant 4: job 7\\napplicant 5: job 8\\n6 applicants can find the job they are interested in.'], 'answer_with_cot': ['Step 1: Analyzing the graph structure and node information\\n- The graph represents a job interest network where the nodes are applicants (0, 1, 2, 3, 4, 5) and jobs (6, 7, 8, 9, 10, 11, 12).\\n- The graph consists of two lists: `applicant_list` and `job_list`, which specify the nodes in the graph.\\n- The `interest_mapping_list` represents edges in the graph, indicating which applicants are interested in which jobs.\\n\\nStep 2: Finding an assignment that maximizes the number of interested applicants getting their desired job\\nTo maximize the number of applicants getting their desired job, we need to find a matching (or assignment) where each job is assigned to at most one applicant, and at most one job is assigned to each applicant.\\n\\nStep 3: Solving the assignment\\nBased on the given graph, we can determine the optimal assignment using different algorithms such as maximum flow or bipartite matching. In this case, since the graph is bipartite, we can use the Hopcroft-Karp algorithm for maximum bipartite matching.\\n\\nStep 4: Applying the Hopcroft-Karp algorithm\\nUsing the Hopcroft-Karp algorithm, we can find the maximum matching in the bipartite graph.\\n\\nThe maximum matching in the bipartite graph:\\n\\nApplicant 0 -> Job 10\\nApplicant 1 -> Job 12\\nApplicant 2 -> Job 9\\nApplicant 3 -> Job 6\\nApplicant 4 -> Job 7\\nApplicant 5 -> Job 8\\n\\nTherefore, the maximum number of applicants (6 out of 6) find the job they are interested in by assigning jobs to applicants based on the maximum matching obtained from the Hopcroft-Karp algorithm.'], 'difficulty': 'easy', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-language-modeling-graph-question-answering-webquestions', 'idx': 15321, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'West Germanic languages\\', \\'Uganda\\', \\'Saz: The Palestinian Rapper for Change\\', \\'Indonesia\\', \\'Cayman Islands\\', \\'Mrs Dalloway\\', \\'Emma\\', \\'Everything Is Fine\\', \\'English Language\\', \\'New Zealand\\', \\'Buffyverse\\', \\'Deseret alphabet\\', \"Niko\\'s rest-place\", \\'Arabic Language\\', \\'English\\', \\'The TEFL Academy Manchester\\', \\'Barbados\\', \\'Bermuda\\', \\'Suffolk dialect\\', \\'Sudan\\', \\'The Closed Doors\\', \\'Arabic, Tunisian Spoken Language\\'];\\n    triple_list = [(\"English Language\" -> \"Barbados\")[relation=\"countries spoken in\"], (\"English Language\" -> \"English\")[relation=\"local name\"], (\"Arabic Language\" -> \"Saz: The Palestinian Rapper for Change\")[relation=\"titles\"], (\"English Language\" -> \"English\")[relation=\"local name\"], (\"English Language\" -> \"English\")[relation=\"local name\"], (\"Arabic Language\" -> \"Arabic, Tunisian Spoken Language\")[relation=\"dialects\"], (\"Arabic Language\" -> \"Everything Is Fine\")[relation=\"titles\"], (\"English Language\" -> \"Suffolk dialect\")[relation=\"dialects\"], (\"English Language\" -> \"Uganda\")[relation=\"countries spoken in\"], (\"English Language\" -> \"Bermuda\")[relation=\"countries spoken in\"], (\"English Language\" -> \"Mrs Dalloway\")[relation=\"works\"], (\"English Language\" -> \"New Zealand\")[relation=\"main country\"], (\"English Language\" -> \"Niko\\'s rest-place\")[relation=\"where spoken\"], (\"Arabic Language\" -> \"The Closed Doors\")[relation=\"titles\"], (\"English Language\" -> \"English\")[relation=\"local name\"], (\"Sudan\" -> \"English Language\")[relation=\"official language\"], (\"English Language\" -> \"West Germanic languages\")[relation=\"language family\"], (\"English Language\" -> \"English\")[relation=\"local name\"], (\"English Language\" -> \"Deseret alphabet\")[relation=\"writing system\"], (\"English Language\" -> \"Emma\")[relation=\"works\"], (\"English Language\" -> \"English\")[relation=\"local name\"], (\"English Language\" -> \"Cayman Islands\")[relation=\"countries spoken in\"], (\"English Language\" -> \"The TEFL Academy Manchester\")[relation=\"subject of\"], (\"English Language\" -> \"Indonesia\")[relation=\"countries spoken in\"], (\"English Language\" -> \"English\")[relation=\"local name\"], (\"English Language\" -> \"Buffyverse\")[relation=\"found in fictional universe\"]];\\n}\\n```\\nTask definition: given a question and a corresponding knowledge graph, and find an entity in the graph and answer the question.\\nQ: what country has english and arabic language as the official language ? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'West Germanic languages\\', \\'Uganda\\', \\'Saz: The Palestinian Rapper for Change\\', \\'Indonesia\\', \\'Cayman Islands\\', \\'Mrs Dalloway\\', \\'Emma\\', \\'Everything Is Fine\\', \\'English Language\\', \\'New Zealand\\', \\'Buffyverse\\', \\'Deseret alphabet\\', \"Niko\\'s rest-place\", \\'Arabic Language\\', \\'English\\', \\'The TEFL Academy Manchester\\', \\'Barbados\\', \\'Bermuda\\', \\'Suffolk dialect\\', \\'Sudan\\', \\'The Closed Doors\\', \\'Arabic, Tunisian Spoken Language\\'];\\n    triple_list = [(\"English Language\" -> \"Barbados\")[relation=\"countries spoken in\"], (\"English Language\" -> \"English\")[relation=\"local name\"], (\"Arabic Language\" -> \"Saz: The Palestinian Rapper for Change\")[relation=\"titles\"], (\"English Language\" -> \"English\")[relation=\"local name\"], (\"English Language\" -> \"English\")[relation=\"local name\"], (\"Arabic Language\" -> \"Arabic, Tunisian Spoken Language\")[relation=\"dialects\"], (\"Arabic Language\" -> \"Everything Is Fine\")[relation=\"titles\"], (\"English Language\" -> \"Suffolk dialect\")[relation=\"dialects\"], (\"English Language\" -> \"Uganda\")[relation=\"countries spoken in\"], (\"English Language\" -> \"Bermuda\")[relation=\"countries spoken in\"], (\"English Language\" -> \"Mrs Dalloway\")[relation=\"works\"], (\"English Language\" -> \"New Zealand\")[relation=\"main country\"], (\"English Language\" -> \"Niko\\'s rest-place\")[relation=\"where spoken\"], (\"Arabic Language\" -> \"The Closed Doors\")[relation=\"titles\"], (\"English Language\" -> \"English\")[relation=\"local name\"], (\"Sudan\" -> \"English Language\")[relation=\"official language\"], (\"English Language\" -> \"West Germanic languages\")[relation=\"language family\"], (\"English Language\" -> \"English\")[relation=\"local name\"], (\"English Language\" -> \"Deseret alphabet\")[relation=\"writing system\"], (\"English Language\" -> \"Emma\")[relation=\"works\"], (\"English Language\" -> \"English\")[relation=\"local name\"], (\"English Language\" -> \"Cayman Islands\")[relation=\"countries spoken in\"], (\"English Language\" -> \"The TEFL Academy Manchester\")[relation=\"subject of\"], (\"English Language\" -> \"Indonesia\")[relation=\"countries spoken in\"], (\"English Language\" -> \"English\")[relation=\"local name\"], (\"English Language\" -> \"Buffyverse\")[relation=\"found in fictional universe\"]];\\n}\\n```', 'graph': {'node_list': ['West Germanic languages', 'Uganda', 'Saz: The Palestinian Rapper for Change', 'Indonesia', 'Cayman Islands', 'Mrs Dalloway', 'Emma', 'Everything Is Fine', 'English Language', 'New Zealand', 'Buffyverse', 'Deseret alphabet', \"Niko's rest-place\", 'Arabic Language', 'English', 'The TEFL Academy Manchester', 'Barbados', 'Bermuda', 'Suffolk dialect', 'Sudan', 'The Closed Doors', 'Arabic, Tunisian Spoken Language'], 'edge_list': [('English Language', 'countries spoken in', 'Barbados'), ('English Language', 'local name', 'English'), ('Arabic Language', 'titles', 'Saz: The Palestinian Rapper for Change'), ('English Language', 'local name', 'English'), ('English Language', 'local name', 'English'), ('Arabic Language', 'dialects', 'Arabic, Tunisian Spoken Language'), ('Arabic Language', 'titles', 'Everything Is Fine'), ('English Language', 'dialects', 'Suffolk dialect'), ('English Language', 'countries spoken in', 'Uganda'), ('English Language', 'countries spoken in', 'Bermuda'), ('English Language', 'works', 'Mrs Dalloway'), ('English Language', 'main country', 'New Zealand'), ('English Language', 'where spoken', \"Niko's rest-place\"), ('Arabic Language', 'titles', 'The Closed Doors'), ('English Language', 'local name', 'English'), ('Sudan', 'official language', 'English Language'), ('English Language', 'language family', 'West Germanic languages'), ('English Language', 'local name', 'English'), ('English Language', 'writing system', 'Deseret alphabet'), ('English Language', 'works', 'Emma'), ('English Language', 'local name', 'English'), ('English Language', 'countries spoken in', 'Cayman Islands'), ('English Language', 'subject of', 'The TEFL Academy Manchester'), ('English Language', 'countries spoken in', 'Indonesia'), ('English Language', 'local name', 'English'), ('English Language', 'found in fictional universe', 'Buffyverse')]}, 'answer': ['Sudan'], 'answer_with_cot': ['To answer the question, we need to find a country that has both English and Arabic as its official languages. We can start by looking for nodes connected to \"English Language\" and \"Arabic Language\" in the knowledge graph.\\n\\nFrom the graph, we can see that \"English Language\" is connected to several countries such as \"Barbados\", \"Uganda\", \"Bermuda\", and \"New Zealand\", among others. Similarly, \"Arabic Language\" is connected to \"Saz: The Palestinian Rapper for Change\", \"Arabic, Tunisian Spoken Language\", \"Everything Is Fine\", and \"The Closed Doors\".\\n\\nSince we are looking for a country, we can ignore the nodes that are not countries. \"Barbados\", \"Uganda\", \"Bermuda\", and \"New Zealand\" are countries connected to \"English Language\", but none of them are connected to \"Arabic Language\".\\n\\nHowever, \"Sudan\" is connected to \"English Language\" with an \"official language\" relation. Since \"Sudan\" is connected to \"English Language\", which has a connection with \"Arabic Language\", we can conclude that Sudan is a country that has both English and Arabic as its official languages.\\n\\nTherefore, the answer to the question \"what country has English and Arabic as the official language?\" is \"Sudan\".', \"('English Language', 'countries spoken in', 'Sudan')\"], 'difficulty': 'medium', 'from': 'WebQuestions'},\n",
       "       {'task_name': 'graph-structure-modeling-graph-topological-sort-nlgraph', 'idx': 22, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"topological-sort\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8];\\n    edge_list = [(2 -> 1), (3 -> 5), (3 -> 2), (4 -> 3), (5 -> 2), (6 -> 5), (7 -> 4), (7 -> 5), (8 -> 6), (8 -> 4), (8 -> 1)];\\n}\\n```\\nTask definition: determine if all the nodes in the graph can be visited.\\nQ: Can all the nodes be visited? Give the solution. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"topological-sort\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8];\\n    edge_list = [(2 -> 1), (3 -> 5), (3 -> 2), (4 -> 3), (5 -> 2), (6 -> 5), (7 -> 4), (7 -> 5), (8 -> 6), (8 -> 4), (8 -> 1)];\\n}\\n```', 'graph': {'node_list': [0, 1, 2, 3, 4, 5, 6, 7, 8], 'edge_list': [('2', '1'), ('3', '5'), ('3', '2'), ('4', '3'), ('5', '2'), ('6', '5'), ('7', '4'), ('7', '5'), ('8', '6'), ('8', '4'), ('8', '1')]}, 'answer': ['The solution is: 0,7,8,6,4,3,5,2,1.'], 'answer_with_cot': ['To determine if all the nodes in the graph can be visited, we can perform a topological sort. \\n\\nStarting with node 0, we can follow the directed edges to visit its neighbors. Then, we can recursively visit the neighbors of each node in a top-down fashion. \\n\\nPerforming a topological sort on the given graph, we get the following order of visited nodes: 0, 8, 6, 7, 4, 3, 5, 2, 1. \\n\\nSince all the nodes in the graph have been visited, we can conclude that yes, all the nodes can be visited.'], 'difficulty': 'easy', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-language-modeling-graph-node-cls-ogbn-products', 'idx': 5665, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"product-graph\"] {\\n    product_node_list = [\"B00A8A5YGC\", \"B00AHED2FE\", \"B00A3NTY56\", \"B009L25PAS\", \"B009A9Z9RG\", \"B009PR88TY\", \"B009UPXZC6\", \"B009X9Z16W\", \"B009C6KFE4\", \"B009QIQRQI\", \"B00F2O9URS\", \"B009RIW7ZM\", \"B009G9LPNC\", \"B009L25N7S\", \"B00BR0EGE8\", \"B00AX9HR40\", \"B009A7RSQS\", \"B00F3S75QQ\", \"B00GT61NPU\", \"B00E9FPDAE\", \"B00ESC55UG\", \"B00A19NQHE\", \"B00ACVJ21K\", \"B009USM3P8\", \"B00GII0YEA\", \"B009GCS7LC\", \"B009JBG0PK\", \"B00DY1VLAK\", \"B009DPR8GW\", \"B003ZD7NEK\", \"B00B4O03WG\"];\\n    product_node_feature = [\"B00AHED2FE\".category=\"Cell.Phones.&.Accessories\", \"B00A3NTY56\".category=\"Cell.Phones.&.Accessories\", \"B009L25PAS\".category=\"Cell.Phones.&.Accessories\", \"B009A9Z9RG\".category=\"Cell.Phones.&.Accessories\", \"B009PR88TY\".category=\"Cell.Phones.&.Accessories\", \"B009UPXZC6\".category=\"Cell.Phones.&.Accessories\", \"B009X9Z16W\".category=\"Cell.Phones.&.Accessories\", \"B009C6KFE4\".category=\"Cell.Phones.&.Accessories\", \"B009QIQRQI\".category=\"Cell.Phones.&.Accessories\", \"B00F2O9URS\".category=\"Cell.Phones.&.Accessories\", \"B009RIW7ZM\".category=\"Cell.Phones.&.Accessories\", \"B009G9LPNC\".category=\"Cell.Phones.&.Accessories\", \"B009L25N7S\".category=\"Cell.Phones.&.Accessories\", \"B00BR0EGE8\".category=\"Cell.Phones.&.Accessories\", \"B00AX9HR40\".category=\"Cell.Phones.&.Accessories\", \"B009A7RSQS\".category=\"Cell.Phones.&.Accessories\", \"B00F3S75QQ\".category=\"\", \"B00GT61NPU\".category=\"Cell.Phones.&.Accessories\", \"B00E9FPDAE\".category=\"Cell.Phones.&.Accessories\", \"B00ESC55UG\".category=\"Cell.Phones.&.Accessories\", \"B00A19NQHE\".category=\"Cell.Phones.&.Accessories\", \"B00ACVJ21K\".category=\"Cell.Phones.&.Accessories\", \"B009USM3P8\".category=\"Cell.Phones.&.Accessories\", \"B00GII0YEA\".category=\"Cell.Phones.&.Accessories\", \"B009GCS7LC\".category=\"Cell.Phones.&.Accessories\", \"B009JBG0PK\".category=\"Cell.Phones.&.Accessories\", \"B00DY1VLAK\".category=\"Cell.Phones.&.Accessories\", \"B009DPR8GW\".category=\"Cell.Phones.&.Accessories\", \"B003ZD7NEK\".category=\"Cell.Phones.&.Accessories\", \"B00B4O03WG\".category=\"Cell.Phones.&.Accessories\"];\\n    product_triple_list = [(\"B00AHED2FE\" -> \"B00A3NTY56\"), (\"B009L25PAS\" -> \"B009A9Z9RG\"), (\"B009PR88TY\" -> \"B009UPXZC6\"), (\"B00A8A5YGC\" -> \"B009X9Z16W\"), (\"B009C6KFE4\" -> \"B009QIQRQI\"), (\"B00A8A5YGC\" -> \"B009C6KFE4\"), (\"B009X9Z16W\" -> \"B00F2O9URS\"), (\"B009L25PAS\" -> \"B009RIW7ZM\"), (\"B00A8A5YGC\" -> \"B00AHED2FE\"), (\"B00AHED2FE\" -> \"B009G9LPNC\"), (\"B009L25PAS\" -> \"B009L25N7S\"), (\"B009PR88TY\" -> \"B00BR0EGE8\"), (\"B00A8A5YGC\" -> \"B009L25PAS\"), (\"B009X9Z16W\" -> \"B00AX9HR40\"), (\"B009C6KFE4\" -> \"B009A7RSQS\"), (\"B009X9Z16W\" -> \"B00F3S75QQ\"), (\"B009PR88TY\" -> \"B00GT61NPU\"), (\"B009L25PAS\" -> \"B00E9FPDAE\"), (\"B009C6KFE4\" -> \"B00ESC55UG\"), (\"B00A8A5YGC\" -> \"B009PR88TY\"), (\"B00AHED2FE\" -> \"B00A19NQHE\"), (\"B009C6KFE4\" -> \"B00ACVJ21K\"), (\"B00AHED2FE\" -> \"B009USM3P8\"), (\"B00AHED2FE\" -> \"B00GII0YEA\"), (\"B009L25PAS\" -> \"B009GCS7LC\"), (\"B009PR88TY\" -> \"B009JBG0PK\"), (\"B009X9Z16W\" -> \"B00DY1VLAK\"), (\"B009PR88TY\" -> \"B009DPR8GW\"), (\"B009C6KFE4\" -> \"B003ZD7NEK\"), (\"B009X9Z16W\" -> \"B00B4O03WG\")];\\n    target_product_node = \"B00A8A5YGC\";\\n}\\n```\\nTask definition: given a product and corresponding graph, classify the target product into one of Digital.Music, Gift.Cards, GPS.&.Navigation, Electronics, Movies.&.TV, Cell.Phones.&.Accessories, Buy.a.Kindle, MP3.Players.&.Accessories, Clothing,.Shoes.&.Jewelry, Industrial.&.Scientific.\\nQ: Please classify the target product. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"product-graph\"] {\\n    product_node_list = [\"B00A8A5YGC\", \"B00AHED2FE\", \"B00A3NTY56\", \"B009L25PAS\", \"B009A9Z9RG\", \"B009PR88TY\", \"B009UPXZC6\", \"B009X9Z16W\", \"B009C6KFE4\", \"B009QIQRQI\", \"B00F2O9URS\", \"B009RIW7ZM\", \"B009G9LPNC\", \"B009L25N7S\", \"B00BR0EGE8\", \"B00AX9HR40\", \"B009A7RSQS\", \"B00F3S75QQ\", \"B00GT61NPU\", \"B00E9FPDAE\", \"B00ESC55UG\", \"B00A19NQHE\", \"B00ACVJ21K\", \"B009USM3P8\", \"B00GII0YEA\", \"B009GCS7LC\", \"B009JBG0PK\", \"B00DY1VLAK\", \"B009DPR8GW\", \"B003ZD7NEK\", \"B00B4O03WG\"];\\n    product_node_feature = [\"B00AHED2FE\".category=\"Cell.Phones.&.Accessories\", \"B00A3NTY56\".category=\"Cell.Phones.&.Accessories\", \"B009L25PAS\".category=\"Cell.Phones.&.Accessories\", \"B009A9Z9RG\".category=\"Cell.Phones.&.Accessories\", \"B009PR88TY\".category=\"Cell.Phones.&.Accessories\", \"B009UPXZC6\".category=\"Cell.Phones.&.Accessories\", \"B009X9Z16W\".category=\"Cell.Phones.&.Accessories\", \"B009C6KFE4\".category=\"Cell.Phones.&.Accessories\", \"B009QIQRQI\".category=\"Cell.Phones.&.Accessories\", \"B00F2O9URS\".category=\"Cell.Phones.&.Accessories\", \"B009RIW7ZM\".category=\"Cell.Phones.&.Accessories\", \"B009G9LPNC\".category=\"Cell.Phones.&.Accessories\", \"B009L25N7S\".category=\"Cell.Phones.&.Accessories\", \"B00BR0EGE8\".category=\"Cell.Phones.&.Accessories\", \"B00AX9HR40\".category=\"Cell.Phones.&.Accessories\", \"B009A7RSQS\".category=\"Cell.Phones.&.Accessories\", \"B00F3S75QQ\".category=\"\", \"B00GT61NPU\".category=\"Cell.Phones.&.Accessories\", \"B00E9FPDAE\".category=\"Cell.Phones.&.Accessories\", \"B00ESC55UG\".category=\"Cell.Phones.&.Accessories\", \"B00A19NQHE\".category=\"Cell.Phones.&.Accessories\", \"B00ACVJ21K\".category=\"Cell.Phones.&.Accessories\", \"B009USM3P8\".category=\"Cell.Phones.&.Accessories\", \"B00GII0YEA\".category=\"Cell.Phones.&.Accessories\", \"B009GCS7LC\".category=\"Cell.Phones.&.Accessories\", \"B009JBG0PK\".category=\"Cell.Phones.&.Accessories\", \"B00DY1VLAK\".category=\"Cell.Phones.&.Accessories\", \"B009DPR8GW\".category=\"Cell.Phones.&.Accessories\", \"B003ZD7NEK\".category=\"Cell.Phones.&.Accessories\", \"B00B4O03WG\".category=\"Cell.Phones.&.Accessories\"];\\n    product_triple_list = [(\"B00AHED2FE\" -> \"B00A3NTY56\"), (\"B009L25PAS\" -> \"B009A9Z9RG\"), (\"B009PR88TY\" -> \"B009UPXZC6\"), (\"B00A8A5YGC\" -> \"B009X9Z16W\"), (\"B009C6KFE4\" -> \"B009QIQRQI\"), (\"B00A8A5YGC\" -> \"B009C6KFE4\"), (\"B009X9Z16W\" -> \"B00F2O9URS\"), (\"B009L25PAS\" -> \"B009RIW7ZM\"), (\"B00A8A5YGC\" -> \"B00AHED2FE\"), (\"B00AHED2FE\" -> \"B009G9LPNC\"), (\"B009L25PAS\" -> \"B009L25N7S\"), (\"B009PR88TY\" -> \"B00BR0EGE8\"), (\"B00A8A5YGC\" -> \"B009L25PAS\"), (\"B009X9Z16W\" -> \"B00AX9HR40\"), (\"B009C6KFE4\" -> \"B009A7RSQS\"), (\"B009X9Z16W\" -> \"B00F3S75QQ\"), (\"B009PR88TY\" -> \"B00GT61NPU\"), (\"B009L25PAS\" -> \"B00E9FPDAE\"), (\"B009C6KFE4\" -> \"B00ESC55UG\"), (\"B00A8A5YGC\" -> \"B009PR88TY\"), (\"B00AHED2FE\" -> \"B00A19NQHE\"), (\"B009C6KFE4\" -> \"B00ACVJ21K\"), (\"B00AHED2FE\" -> \"B009USM3P8\"), (\"B00AHED2FE\" -> \"B00GII0YEA\"), (\"B009L25PAS\" -> \"B009GCS7LC\"), (\"B009PR88TY\" -> \"B009JBG0PK\"), (\"B009X9Z16W\" -> \"B00DY1VLAK\"), (\"B009PR88TY\" -> \"B009DPR8GW\"), (\"B009C6KFE4\" -> \"B003ZD7NEK\"), (\"B009X9Z16W\" -> \"B00B4O03WG\")];\\n    target_product_node = \"B00A8A5YGC\";\\n}\\n```', 'graph': {'node_list': ['B00A8A5YGC', 'B00AHED2FE', 'B00A3NTY56', 'B009L25PAS', 'B009A9Z9RG', 'B009PR88TY', 'B009UPXZC6', 'B009X9Z16W', 'B009C6KFE4', 'B009QIQRQI', 'B00F2O9URS', 'B009RIW7ZM', 'B009G9LPNC', 'B009L25N7S', 'B00BR0EGE8', 'B00AX9HR40', 'B009A7RSQS', 'B00F3S75QQ', 'B00GT61NPU', 'B00E9FPDAE', 'B00ESC55UG', 'B00A19NQHE', 'B00ACVJ21K', 'B009USM3P8', 'B00GII0YEA', 'B009GCS7LC', 'B009JBG0PK', 'B00DY1VLAK', 'B009DPR8GW', 'B003ZD7NEK', 'B00B4O03WG'], 'edge_list': [('B00AHED2FE', 'B00A3NTY56'), ('B009L25PAS', 'B009A9Z9RG'), ('B009PR88TY', 'B009UPXZC6'), ('B00A8A5YGC', 'B009X9Z16W'), ('B009C6KFE4', 'B009QIQRQI'), ('B00A8A5YGC', 'B009C6KFE4'), ('B009X9Z16W', 'B00F2O9URS'), ('B009L25PAS', 'B009RIW7ZM'), ('B00A8A5YGC', 'B00AHED2FE'), ('B00AHED2FE', 'B009G9LPNC'), ('B009L25PAS', 'B009L25N7S'), ('B009PR88TY', 'B00BR0EGE8'), ('B00A8A5YGC', 'B009L25PAS'), ('B009X9Z16W', 'B00AX9HR40'), ('B009C6KFE4', 'B009A7RSQS'), ('B009X9Z16W', 'B00F3S75QQ'), ('B009PR88TY', 'B00GT61NPU'), ('B009L25PAS', 'B00E9FPDAE'), ('B009C6KFE4', 'B00ESC55UG'), ('B00A8A5YGC', 'B009PR88TY'), ('B00AHED2FE', 'B00A19NQHE'), ('B009C6KFE4', 'B00ACVJ21K'), ('B00AHED2FE', 'B009USM3P8'), ('B00AHED2FE', 'B00GII0YEA'), ('B009L25PAS', 'B009GCS7LC'), ('B009PR88TY', 'B009JBG0PK'), ('B009X9Z16W', 'B00DY1VLAK'), ('B009PR88TY', 'B009DPR8GW'), ('B009C6KFE4', 'B003ZD7NEK'), ('B009X9Z16W', 'B00B4O03WG')], 'node_feature': {'B00AHED2FE': {'label': 'Cell.Phones.&.Accessories'}, 'B00A3NTY56': {'label': 'Cell.Phones.&.Accessories'}, 'B009L25PAS': {'label': 'Cell.Phones.&.Accessories'}, 'B009A9Z9RG': {'label': 'Cell.Phones.&.Accessories'}, 'B009PR88TY': {'label': 'Cell.Phones.&.Accessories'}, 'B009UPXZC6': {'label': 'Cell.Phones.&.Accessories'}, 'B009X9Z16W': {'label': 'Cell.Phones.&.Accessories'}, 'B009C6KFE4': {'label': 'Cell.Phones.&.Accessories'}, 'B009QIQRQI': {'label': 'Cell.Phones.&.Accessories'}, 'B00F2O9URS': {'label': 'Cell.Phones.&.Accessories'}, 'B009RIW7ZM': {'label': 'Cell.Phones.&.Accessories'}, 'B009G9LPNC': {'label': 'Cell.Phones.&.Accessories'}, 'B009L25N7S': {'label': 'Cell.Phones.&.Accessories'}, 'B00BR0EGE8': {'label': 'Cell.Phones.&.Accessories'}, 'B00AX9HR40': {'label': 'Cell.Phones.&.Accessories'}, 'B009A7RSQS': {'label': 'Cell.Phones.&.Accessories'}, 'B00F3S75QQ': {'label': ''}, 'B00GT61NPU': {'label': 'Cell.Phones.&.Accessories'}, 'B00E9FPDAE': {'label': 'Cell.Phones.&.Accessories'}, 'B00ESC55UG': {'label': 'Cell.Phones.&.Accessories'}, 'B00A19NQHE': {'label': 'Cell.Phones.&.Accessories'}, 'B00ACVJ21K': {'label': 'Cell.Phones.&.Accessories'}, 'B009USM3P8': {'label': 'Cell.Phones.&.Accessories'}, 'B00GII0YEA': {'label': 'Cell.Phones.&.Accessories'}, 'B009GCS7LC': {'label': 'Cell.Phones.&.Accessories'}, 'B009JBG0PK': {'label': 'Cell.Phones.&.Accessories'}, 'B00DY1VLAK': {'label': 'Cell.Phones.&.Accessories'}, 'B009DPR8GW': {'label': 'Cell.Phones.&.Accessories'}, 'B003ZD7NEK': {'label': 'Cell.Phones.&.Accessories'}, 'B00B4O03WG': {'label': 'Cell.Phones.&.Accessories'}}}, 'answer': ['Cell.Phones.&.Accessories'], 'answer_with_cot': ['To classify the target product, we need to determine its category based on the given graph and the node information. \\n\\nStep 1: Find the neighbors of the target product node (\"B00A8A5YGC\") in the graph.\\n\\nAccording to the \"product_triple_list\" in the graph, the neighbors of \"B00A8A5YGC\" are:\\n- \"B009C6KFE4\"\\n- \"B009X9Z16W\"\\n- \"B009PR88TY\"\\n- \"B00AHED2FE\"\\n- \"B00BR0EGE8\"\\n- \"B009L25PAS\"\\n\\nStep 2: Check the category information for each neighbor node.\\n\\nBased on the \"product_node_feature\" information in the graph, we can determine the category of each neighbor node:\\n- \"B009C6KFE4\" -> Cell.Phones.&.Accessories\\n- \"B009X9Z16W\" -> Cell.Phones.&.Accessories\\n- \"B009PR88TY\" -> Cell.Phones.&.Accessories\\n- \"B00AHED2FE\" -> Cell.Phones.&.Accessories\\n- \"B00BR0EGE8\" -> Cell.Phones.&.Accessories\\n- \"B009L25PAS\" -> Cell.Phones.&.Accessories\\n\\nStep 3: Determine the category of the target product.\\n\\nSince all the neighboring nodes have the same category \"Cell.Phones.&.Accessories\", we can conclude that the target product \"B00A8A5YGC\" also belongs to the category \"Cell.Phones.&.Accessories\".'], 'difficulty': 'easy', 'from': 'OGBN-Products'},\n",
       "       {'task_name': 'graph-structure-modeling-graph-connectivity-detection-nlgraph', 'idx': 419, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"connectivity-detection\"] {\\n    node_list = [0, 1, 2, 3, 4];\\n    edge_list = [(0 <-> 3), (0 <-> 4), (1 <-> 2), (3 <-> 4)];\\n}\\n```\\nTask definition: determine if there is a path between two nodes in the graph.\\nQ: Is there a path between node 2 and node 4? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"connectivity-detection\"] {\\n    node_list = [0, 1, 2, 3, 4];\\n    edge_list = [(0 <-> 3), (0 <-> 4), (1 <-> 2), (3 <-> 4)];\\n}\\n```', 'graph': {'node_list': [0, 1, 2, 3, 4], 'edge_list': [('0', '3'), ('0', '4'), ('1', '2'), ('3', '4')]}, 'answer': ['The answer is no.'], 'answer_with_cot': ['To determine if there is a path between node 2 and node 4, we can start from node 2 and traverse the graph to see if we can reach node 4.\\n\\nStarting from node 2, we can see that it is connected to node 1 with an undirected edge (1 <-> 2). From node 1, there are no further connections. Therefore, there is no direct path from node 2 to node 4.\\n\\nSimilarly, we can start from node 4 and see that it is connected to node 0 with an undirected edge (0 <-> 4), and node 0 is connected to node 3 with an undirected edge (0 <-> 3). From node 3, there are no further connections. Therefore, there is no direct path from node 4 to node 2.\\n\\nSince there is no direct path from node 2 to node 4 and vice versa, there is no path between node 2 and node 4 in the graph.'], 'difficulty': 'easy', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-language-modeling-graph-question-answering-webquestions', 'idx': 17598, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'Argentina\\', \\'Camila\\', \\'Comuna 15\\', \\'Concepción del Uruguay\\', \\'Spanish Language\\', \\'Alfredo Guttero\\', \\'Juan Acosta\\', \\'The Stendhal Syndrome\\', \\'Bolivia\\', \\'Vanina Oneto\\', \"Nobody\\'s Wife\", \\'Coleccion Pedro Infante: Viva Mi Desgracia\\', \\'Mario Pierani\\', \\'Telsen Department\\', \\'Italian Language\\', \\'Eliseo Giusfredi\\', \\'Enrique Rodríguez\\', \\'Mario Faig\\', \\'Comandante Luis Piedrabuena\\', \\'Governor Francisco Gabrielli International Airport\\', \\'Vereda Tropical\\', \\'Alto Valle thermal power plant\\', \\'Africa Blood and Guts\\', \\'Uruguay River pulp mill dispute\\', \\'Poldy Bird\\', \\'Margarita Bali\\', \"Giulia Doesn\\'t Date at Night\", \\'Osvaldo Héctor Cruz\\', \\'Antártida Argentina railway station\\'];\\n    triple_list = [(\"Argentina\" -> \"Antártida Argentina railway station\")[relation=\"contains\"], (\"Italian Language\" -> \"The Stendhal Syndrome\")[relation=\"titles\"], (\"Spanish Language\" -> \"Bolivia\")[relation=\"countries spoken in\"], (\"Argentina\" -> \"Osvaldo Héctor Cruz\")[relation=\"people born here\"], (\"Italian Language\" -> \"Africa Blood and Guts\")[relation=\"titles\"], (\"Spanish Language\" -> \"Camila\")[relation=\"titles\"], (\"Argentina\" -> \"Vereda Tropical\")[relation=\"titles\"], (\"Argentina\" -> \"Mario Faig\")[relation=\"people born here\"], (\"Argentina\" -> \"Vanina Oneto\")[relation=\"people born here\"], (\"Argentina\" -> \"Eliseo Giusfredi\")[relation=\"people born here\"], (\"Argentina\" -> \"Telsen Department\")[relation=\"contains\"], (\"Argentina\" -> \"Alto Valle thermal power plant\")[relation=\"contains\"], (\"Argentina\" -> \"Comuna 15\")[relation=\"contains\"], (\"Argentina\" -> \"Juan Acosta\")[relation=\"people born here\"], (\"Argentina\" -> \"Poldy Bird\")[relation=\"people born here\"], (\"Argentina\" -> \"Alfredo Guttero\")[relation=\"people born here\"], (\"Argentina\" -> \"Mario Pierani\")[relation=\"people born here\"], (\"Argentina\" -> \"Enrique Rodríguez\")[relation=\"people born here\"], (\"Argentina\" -> \"Concepción del Uruguay\")[relation=\"contains\"], (\"Spanish Language\" -> \"Nobody\\'s Wife\")[relation=\"titles\"], (\"Argentina\" -> \"Margarita Bali\")[relation=\"people born here\"], (\"Argentina\" -> \"Governor Francisco Gabrielli International Airport\")[relation=\"contains\"], (\"Argentina\" -> \"Uruguay River pulp mill dispute\")[relation=\"events\"], (\"Spanish Language\" -> \"Coleccion Pedro Infante: Viva Mi Desgracia\")[relation=\"titles\"], (\"Italian Language\" -> \"Giulia Doesn\\'t Date at Night\")[relation=\"titles\"], (\"Argentina\" -> \"Comandante Luis Piedrabuena\")[relation=\"contains\"]];\\n}\\n```\\nTask definition: given a question and a corresponding knowledge graph, and find an entity in the graph and answer the question.\\nQ: what languages are spoken in the country with mendoza province ? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'Argentina\\', \\'Camila\\', \\'Comuna 15\\', \\'Concepción del Uruguay\\', \\'Spanish Language\\', \\'Alfredo Guttero\\', \\'Juan Acosta\\', \\'The Stendhal Syndrome\\', \\'Bolivia\\', \\'Vanina Oneto\\', \"Nobody\\'s Wife\", \\'Coleccion Pedro Infante: Viva Mi Desgracia\\', \\'Mario Pierani\\', \\'Telsen Department\\', \\'Italian Language\\', \\'Eliseo Giusfredi\\', \\'Enrique Rodríguez\\', \\'Mario Faig\\', \\'Comandante Luis Piedrabuena\\', \\'Governor Francisco Gabrielli International Airport\\', \\'Vereda Tropical\\', \\'Alto Valle thermal power plant\\', \\'Africa Blood and Guts\\', \\'Uruguay River pulp mill dispute\\', \\'Poldy Bird\\', \\'Margarita Bali\\', \"Giulia Doesn\\'t Date at Night\", \\'Osvaldo Héctor Cruz\\', \\'Antártida Argentina railway station\\'];\\n    triple_list = [(\"Argentina\" -> \"Antártida Argentina railway station\")[relation=\"contains\"], (\"Italian Language\" -> \"The Stendhal Syndrome\")[relation=\"titles\"], (\"Spanish Language\" -> \"Bolivia\")[relation=\"countries spoken in\"], (\"Argentina\" -> \"Osvaldo Héctor Cruz\")[relation=\"people born here\"], (\"Italian Language\" -> \"Africa Blood and Guts\")[relation=\"titles\"], (\"Spanish Language\" -> \"Camila\")[relation=\"titles\"], (\"Argentina\" -> \"Vereda Tropical\")[relation=\"titles\"], (\"Argentina\" -> \"Mario Faig\")[relation=\"people born here\"], (\"Argentina\" -> \"Vanina Oneto\")[relation=\"people born here\"], (\"Argentina\" -> \"Eliseo Giusfredi\")[relation=\"people born here\"], (\"Argentina\" -> \"Telsen Department\")[relation=\"contains\"], (\"Argentina\" -> \"Alto Valle thermal power plant\")[relation=\"contains\"], (\"Argentina\" -> \"Comuna 15\")[relation=\"contains\"], (\"Argentina\" -> \"Juan Acosta\")[relation=\"people born here\"], (\"Argentina\" -> \"Poldy Bird\")[relation=\"people born here\"], (\"Argentina\" -> \"Alfredo Guttero\")[relation=\"people born here\"], (\"Argentina\" -> \"Mario Pierani\")[relation=\"people born here\"], (\"Argentina\" -> \"Enrique Rodríguez\")[relation=\"people born here\"], (\"Argentina\" -> \"Concepción del Uruguay\")[relation=\"contains\"], (\"Spanish Language\" -> \"Nobody\\'s Wife\")[relation=\"titles\"], (\"Argentina\" -> \"Margarita Bali\")[relation=\"people born here\"], (\"Argentina\" -> \"Governor Francisco Gabrielli International Airport\")[relation=\"contains\"], (\"Argentina\" -> \"Uruguay River pulp mill dispute\")[relation=\"events\"], (\"Spanish Language\" -> \"Coleccion Pedro Infante: Viva Mi Desgracia\")[relation=\"titles\"], (\"Italian Language\" -> \"Giulia Doesn\\'t Date at Night\")[relation=\"titles\"], (\"Argentina\" -> \"Comandante Luis Piedrabuena\")[relation=\"contains\"]];\\n}\\n```', 'graph': {'node_list': ['Argentina', 'Camila', 'Comuna 15', 'Concepción del Uruguay', 'Spanish Language', 'Alfredo Guttero', 'Juan Acosta', 'The Stendhal Syndrome', 'Bolivia', 'Vanina Oneto', \"Nobody's Wife\", 'Coleccion Pedro Infante: Viva Mi Desgracia', 'Mario Pierani', 'Telsen Department', 'Italian Language', 'Eliseo Giusfredi', 'Enrique Rodríguez', 'Mario Faig', 'Comandante Luis Piedrabuena', 'Governor Francisco Gabrielli International Airport', 'Vereda Tropical', 'Alto Valle thermal power plant', 'Africa Blood and Guts', 'Uruguay River pulp mill dispute', 'Poldy Bird', 'Margarita Bali', \"Giulia Doesn't Date at Night\", 'Osvaldo Héctor Cruz', 'Antártida Argentina railway station'], 'edge_list': [('Argentina', 'contains', 'Antártida Argentina railway station'), ('Italian Language', 'titles', 'The Stendhal Syndrome'), ('Spanish Language', 'countries spoken in', 'Bolivia'), ('Argentina', 'people born here', 'Osvaldo Héctor Cruz'), ('Italian Language', 'titles', 'Africa Blood and Guts'), ('Spanish Language', 'titles', 'Camila'), ('Argentina', 'titles', 'Vereda Tropical'), ('Argentina', 'people born here', 'Mario Faig'), ('Argentina', 'people born here', 'Vanina Oneto'), ('Argentina', 'people born here', 'Eliseo Giusfredi'), ('Argentina', 'contains', 'Telsen Department'), ('Argentina', 'contains', 'Alto Valle thermal power plant'), ('Argentina', 'contains', 'Comuna 15'), ('Argentina', 'people born here', 'Juan Acosta'), ('Argentina', 'people born here', 'Poldy Bird'), ('Argentina', 'people born here', 'Alfredo Guttero'), ('Argentina', 'people born here', 'Mario Pierani'), ('Argentina', 'people born here', 'Enrique Rodríguez'), ('Argentina', 'contains', 'Concepción del Uruguay'), ('Spanish Language', 'titles', \"Nobody's Wife\"), ('Argentina', 'people born here', 'Margarita Bali'), ('Argentina', 'contains', 'Governor Francisco Gabrielli International Airport'), ('Argentina', 'events', 'Uruguay River pulp mill dispute'), ('Spanish Language', 'titles', 'Coleccion Pedro Infante: Viva Mi Desgracia'), ('Italian Language', 'titles', \"Giulia Doesn't Date at Night\"), ('Argentina', 'contains', 'Comandante Luis Piedrabuena')]}, 'answer': ['Yiddish Language', 'Italian Language', 'Spanish Language'], 'answer_with_cot': ['To answer this question, we need to find the entity representing the country with Mendoza province in the knowledge graph. Once we find that entity, we can look for the edges connecting it to the language nodes and extract the languages spoken.\\n\\nFrom the given graph, we can see that the entity \"Argentina\" represents the country, which contains the province \"Mendoza\" (not explicitly mentioned in the graph, but is known). Therefore, we need to find the edges connecting \"Argentina\" with the language nodes.\\n\\nIn the graph, we have the following relevant edges:\\n1. (\"Spanish Language\" -> \"Bolivia\")[relation=\"countries spoken in\"]\\n2. (\"Italian Language\" -> \"The Stendhal Syndrome\")[relation=\"titles\"]\\n3. (\"Spanish Language\" -> \"Camila\")[relation=\"titles\"]\\n4. (\"Italian Language\" -> \"Africa Blood and Guts\")[relation=\"titles\"]\\n5. (\"Spanish Language\" -> \"Nobody\\'s Wife\")[relation=\"titles\"]\\n6. (\"Spanish Language\" -> \"Coleccion Pedro Infante: Viva Mi Desgracia\")[relation=\"titles\"]\\n7. (\"Italian Language\" -> \"Giulia Doesn\\'t Date at Night\")[relation=\"titles\"]\\n\\nOut of these edges, only edge number 1 is relevant to the question as it connects the entity \"Argentina\" with the language node \"Spanish Language\".\\n\\nTherefore, the answer to the question \"what languages are spoken in the country with Mendoza province?\" is \"Spanish Language\".', \"('Argentina', 'languages spoken', 'Italian Language')\"], 'difficulty': 'medium', 'from': 'WebQuestions'},\n",
       "       {'task_name': 'graph-structure-modeling-graph-degree-computing-nlgraph', 'idx': 1478, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"degree-computing\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19];\\n    edge_list = [(0 <-> 2), (1 <-> 18), (1 <-> 12), (1 <-> 15), (1 <-> 7), (2 <-> 17), (2 <-> 3), (3 <-> 17), (4 <-> 12), (5 <-> 17), (5 <-> 19), (6 <-> 18), (6 <-> 10), (6 <-> 9), (6 <-> 12), (6 <-> 16), (7 <-> 18), (7 <-> 9), (7 <-> 13), (7 <-> 8), (8 <-> 14), (9 <-> 18), (9 <-> 14), (9 <-> 12), (9 <-> 13), (10 <-> 12), (10 <-> 15), (11 <-> 17), (12 <-> 16), (14 <-> 18)];\\n    target_node = 5;\\n}```\\nTask definition: calculate the degree of the target node in the graph.\\nQ: What\\'s the degree of the target node? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"degree-computing\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19];\\n    edge_list = [(0 <-> 2), (1 <-> 18), (1 <-> 12), (1 <-> 15), (1 <-> 7), (2 <-> 17), (2 <-> 3), (3 <-> 17), (4 <-> 12), (5 <-> 17), (5 <-> 19), (6 <-> 18), (6 <-> 10), (6 <-> 9), (6 <-> 12), (6 <-> 16), (7 <-> 18), (7 <-> 9), (7 <-> 13), (7 <-> 8), (8 <-> 14), (9 <-> 18), (9 <-> 14), (9 <-> 12), (9 <-> 13), (10 <-> 12), (10 <-> 15), (11 <-> 17), (12 <-> 16), (14 <-> 18)];\\n    target_node = 5;\\n}```', 'graph': {'node_list': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], 'edge_list': [('0', '2'), ('1', '18'), ('1', '12'), ('1', '15'), ('1', '7'), ('2', '17'), ('2', '3'), ('3', '17'), ('4', '12'), ('5', '17'), ('5', '19'), ('6', '18'), ('6', '10'), ('6', '9'), ('6', '12'), ('6', '16'), ('7', '18'), ('7', '9'), ('7', '13'), ('7', '8'), ('8', '14'), ('9', '18'), ('9', '14'), ('9', '12'), ('9', '13'), ('10', '12'), ('10', '15'), ('11', '17'), ('12', '16'), ('14', '18')], 'target_node': 5}, 'answer': ['The degree of the target node 5 is 2'], 'answer_with_cot': ['To find the degree of the target node, we need to count the number of edges connected to it. Looking at the graph, we can see that the target node is 5. \\n\\nChecking the edge list, we can determine that the following edges are connected to node 5: (5 <-> 17) and (5 <-> 19).\\n\\nTherefore, the degree of the target node (node 5) is 2.'], 'difficulty': 'easy', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-structure-modeling-graph-shortest-path-nlgraph', 'idx': 184, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"shortest-path\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\\n    edge_list = [(0 <-> 9)[weight=2], (1 <-> 5)[weight=7], (1 <-> 6)[weight=1], (1 <-> 10)[weight=10], (2 <-> 3)[weight=8], (2 <-> 10)[weight=5], (3 <-> 4)[weight=10], (3 <-> 8)[weight=6], (3 <-> 6)[weight=4], (3 <-> 10)[weight=9], (4 <-> 7)[weight=4], (5 <-> 9)[weight=7], (7 <-> 8)[weight=6]];\\n}\\n```\\nTask definition: find a shortest path between two nodes in the graph, and calculate the sum of the weights in the shortest path.\\nQ: Give the shortest path from node 8 to node 0. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"shortest-path\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\\n    edge_list = [(0 <-> 9)[weight=2], (1 <-> 5)[weight=7], (1 <-> 6)[weight=1], (1 <-> 10)[weight=10], (2 <-> 3)[weight=8], (2 <-> 10)[weight=5], (3 <-> 4)[weight=10], (3 <-> 8)[weight=6], (3 <-> 6)[weight=4], (3 <-> 10)[weight=9], (4 <-> 7)[weight=4], (5 <-> 9)[weight=7], (7 <-> 8)[weight=6]];\\n}\\n```', 'graph': {'node_list': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 'edge_list': [('0', '2', '9'), ('1', '7', '5'), ('1', '1', '6'), ('1', '10', '10'), ('2', '8', '3'), ('2', '5', '10'), ('3', '10', '4'), ('3', '6', '8'), ('3', '4', '6'), ('3', '9', '10'), ('4', '4', '7'), ('5', '7', '9'), ('7', '6', '8')]}, 'answer': ['The shortest path from node 8 to node 0 is 8,3,6,1,5,9,0 with a total weight of 27'], 'answer_with_cot': [\"To find the shortest path from node 8 to node 0, we can use Dijkstra's algorithm or a similar shortest path algorithm. Let's go through the steps:\\n\\n1. Start at node 8 and initialize the distance to all other nodes as infinity, except for node 8 which is set to 0. Also, create a set of unvisited nodes containing all nodes in the graph.\\n\\n2. Among the unvisited nodes, select the node with the smallest distance. In this case, node 8 has the smallest distance of 0.\\n\\n3. For the selected node (node 8), consider all its neighboring nodes that haven't been visited yet. Update the distance to each neighboring node if a shorter path is found. The updated distances for the neighbors of node 8 are as follows:\\n   - Node 3: distance = 6 (via node 8, weight = 6)\\n   - Node 7: distance = 4 (via node 3, weight = 4)\\n\\n4. Mark node 8 as visited and remove it from the set of unvisited nodes.\\n\\n5. Repeat steps 2-4 until all nodes have been visited or the target node (node 0) is visited.\\n\\n6. Once node 0 is visited, we have found the shortest path from node 8 to node 0. To reconstruct the path, start from node 0 and follow the predecessors until node 8 is reached. The shortest path is: 8 -> 3 -> 4 -> 7 -> 0.\\n\\n7. Calculate the sum of the weights in the shortest path: 6 + 10 + 4 + 2 = 22.\\n\\nSo, the shortest path from node 8 to node 0 is 8 -> 3 -> 4 -> 7 -> 0, with a total weight of 22.\"], 'difficulty': 'hard', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-language-modeling-graph-question-answering-webquestions', 'idx': 95, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'Ernie Parker\\', \\'City of Port Phillip\\', \\'Maffra Secondary College\\', \\'Australia\\', \\'Philadelphia English\\', \\'Richard Gill\\', \\'Ouyen\\', \\'Phil Keros\\', \\'English Language\\', \\'Christopher Aliendi\\', \\'Glenelg River\\', \\'Merimbula\\', \"Roget\\'s Thesaurus\", \\'The TEFL Academy London\\', \\'Tasmanian Museum and Art Gallery\\', \\'Sevenhill\\', \\'Hartley Teakle\\', \\'National Action\\', \\'Bondi Beach\\', \\'Blue Fin\\', \\'Sylvia Hale\\', \\'Rural City of Murray Bridge\\', \\'Westbury\\', \\'Brisbane Water\\', \\'Via Tania\\', \\'DEJAN\\', \\'The Turning\\', \\'Pilliga\\'];\\n    triple_list = [(\"Australia\" -> \"Richard Gill\")[relation=\"people born here\"], (\"English Language\" -> \"Philadelphia English\")[relation=\"dialects\"], (\"Australia\" -> \"Rural City of Murray Bridge\")[relation=\"contains\"], (\"Australia\" -> \"Sevenhill\")[relation=\"contains\"], (\"Australia\" -> \"Christopher Aliendi\")[relation=\"people born here\"], (\"Australia\" -> \"Glenelg River\")[relation=\"contains\"], (\"Australia\" -> \"Merimbula\")[relation=\"contains\"], (\"Australia\" -> \"The Turning\")[relation=\"works\"], (\"Australia\" -> \"Brisbane Water\")[relation=\"contains\"], (\"Australia\" -> \"Maffra Secondary College\")[relation=\"contains\"], (\"Australia\" -> \"Ouyen\")[relation=\"contains\"], (\"Australia\" -> \"National Action\")[relation=\"organizations with this scope\"], (\"Australia\" -> \"Blue Fin\")[relation=\"works\"], (\"Australia\" -> \"Pilliga\")[relation=\"contains\"], (\"Australia\" -> \"Tasmanian Museum and Art Gallery\")[relation=\"contains\"], (\"Australia\" -> \"DEJAN\")[relation=\"organizations with this scope\"], (\"Australia\" -> \"Via Tania\")[relation=\"people born here\"], (\"Australia\" -> \"Phil Keros\")[relation=\"people born here\"], (\"Australia\" -> \"Bondi Beach\")[relation=\"contains\"], (\"Australia\" -> \"Sylvia Hale\")[relation=\"people born here\"], (\"Australia\" -> \"Westbury\")[relation=\"contains\"], (\"English Language\" -> \"The TEFL Academy London\")[relation=\"subject of\"], (\"Australia\" -> \"Ernie Parker\")[relation=\"people born here\"], (\"Australia\" -> \"Hartley Teakle\")[relation=\"people born here\"], (\"English Language\" -> \"Roget\\'s Thesaurus\")[relation=\"works\"], (\"Australia\" -> \"City of Port Phillip\")[relation=\"contains\"]];\\n}\\n```\\nTask definition: given a question and a corresponding knowledge graph, and find an entity in the graph and answer the question.\\nQ: what language do australian people speak ? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'Ernie Parker\\', \\'City of Port Phillip\\', \\'Maffra Secondary College\\', \\'Australia\\', \\'Philadelphia English\\', \\'Richard Gill\\', \\'Ouyen\\', \\'Phil Keros\\', \\'English Language\\', \\'Christopher Aliendi\\', \\'Glenelg River\\', \\'Merimbula\\', \"Roget\\'s Thesaurus\", \\'The TEFL Academy London\\', \\'Tasmanian Museum and Art Gallery\\', \\'Sevenhill\\', \\'Hartley Teakle\\', \\'National Action\\', \\'Bondi Beach\\', \\'Blue Fin\\', \\'Sylvia Hale\\', \\'Rural City of Murray Bridge\\', \\'Westbury\\', \\'Brisbane Water\\', \\'Via Tania\\', \\'DEJAN\\', \\'The Turning\\', \\'Pilliga\\'];\\n    triple_list = [(\"Australia\" -> \"Richard Gill\")[relation=\"people born here\"], (\"English Language\" -> \"Philadelphia English\")[relation=\"dialects\"], (\"Australia\" -> \"Rural City of Murray Bridge\")[relation=\"contains\"], (\"Australia\" -> \"Sevenhill\")[relation=\"contains\"], (\"Australia\" -> \"Christopher Aliendi\")[relation=\"people born here\"], (\"Australia\" -> \"Glenelg River\")[relation=\"contains\"], (\"Australia\" -> \"Merimbula\")[relation=\"contains\"], (\"Australia\" -> \"The Turning\")[relation=\"works\"], (\"Australia\" -> \"Brisbane Water\")[relation=\"contains\"], (\"Australia\" -> \"Maffra Secondary College\")[relation=\"contains\"], (\"Australia\" -> \"Ouyen\")[relation=\"contains\"], (\"Australia\" -> \"National Action\")[relation=\"organizations with this scope\"], (\"Australia\" -> \"Blue Fin\")[relation=\"works\"], (\"Australia\" -> \"Pilliga\")[relation=\"contains\"], (\"Australia\" -> \"Tasmanian Museum and Art Gallery\")[relation=\"contains\"], (\"Australia\" -> \"DEJAN\")[relation=\"organizations with this scope\"], (\"Australia\" -> \"Via Tania\")[relation=\"people born here\"], (\"Australia\" -> \"Phil Keros\")[relation=\"people born here\"], (\"Australia\" -> \"Bondi Beach\")[relation=\"contains\"], (\"Australia\" -> \"Sylvia Hale\")[relation=\"people born here\"], (\"Australia\" -> \"Westbury\")[relation=\"contains\"], (\"English Language\" -> \"The TEFL Academy London\")[relation=\"subject of\"], (\"Australia\" -> \"Ernie Parker\")[relation=\"people born here\"], (\"Australia\" -> \"Hartley Teakle\")[relation=\"people born here\"], (\"English Language\" -> \"Roget\\'s Thesaurus\")[relation=\"works\"], (\"Australia\" -> \"City of Port Phillip\")[relation=\"contains\"]];\\n}\\n```', 'graph': {'node_list': ['Ernie Parker', 'City of Port Phillip', 'Maffra Secondary College', 'Australia', 'Philadelphia English', 'Richard Gill', 'Ouyen', 'Phil Keros', 'English Language', 'Christopher Aliendi', 'Glenelg River', 'Merimbula', \"Roget's Thesaurus\", 'The TEFL Academy London', 'Tasmanian Museum and Art Gallery', 'Sevenhill', 'Hartley Teakle', 'National Action', 'Bondi Beach', 'Blue Fin', 'Sylvia Hale', 'Rural City of Murray Bridge', 'Westbury', 'Brisbane Water', 'Via Tania', 'DEJAN', 'The Turning', 'Pilliga'], 'edge_list': [('Australia', 'people born here', 'Richard Gill'), ('English Language', 'dialects', 'Philadelphia English'), ('Australia', 'contains', 'Rural City of Murray Bridge'), ('Australia', 'contains', 'Sevenhill'), ('Australia', 'people born here', 'Christopher Aliendi'), ('Australia', 'contains', 'Glenelg River'), ('Australia', 'contains', 'Merimbula'), ('Australia', 'works', 'The Turning'), ('Australia', 'contains', 'Brisbane Water'), ('Australia', 'contains', 'Maffra Secondary College'), ('Australia', 'contains', 'Ouyen'), ('Australia', 'organizations with this scope', 'National Action'), ('Australia', 'works', 'Blue Fin'), ('Australia', 'contains', 'Pilliga'), ('Australia', 'contains', 'Tasmanian Museum and Art Gallery'), ('Australia', 'organizations with this scope', 'DEJAN'), ('Australia', 'people born here', 'Via Tania'), ('Australia', 'people born here', 'Phil Keros'), ('Australia', 'contains', 'Bondi Beach'), ('Australia', 'people born here', 'Sylvia Hale'), ('Australia', 'contains', 'Westbury'), ('English Language', 'subject of', 'The TEFL Academy London'), ('Australia', 'people born here', 'Ernie Parker'), ('Australia', 'people born here', 'Hartley Teakle'), ('English Language', 'works', \"Roget's Thesaurus\"), ('Australia', 'contains', 'City of Port Phillip')]}, 'answer': ['English Language', 'Lojban', 'Esperanto Language'], 'answer_with_cot': ['To answer the question \"what language do Australian people speak?\", we need to find the entity in the graph that represents the language spoken by Australian people. \\n\\nBased on the given knowledge graph, we can start by finding the entity connected to the node \"Australia\" via the relation \"contains\". Looking at the graph, we can see that there is a connection between \"Australia\" and \"English Language\" with the relation \"contains\". \\n\\nTherefore, the language spoken by Australian people is \"English Language\".', \"('Australia', 'languages spoken', 'Esperanto Language')\"], 'difficulty': 'medium', 'from': 'WebQuestions'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-wikidata5m', 'idx': 27459, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'infogrames\\', \\'Singleplayer video games\\', \\'multi-player video game\\', \\'CD-ROM\\', \\'Windows Applications\\', \\'Leisure software\\', \\'tommo, inc.\\', \\'slave zero\\', \\'accolade (developer)\\', \\'Action games\\'];\\n    triple_list = [(\"slave zero\" -> \"Action games\")[relation=\"genre\"], (\"slave zero\" -> \"tommo, inc.\")[relation=\"distributor\"], (\"slave zero\" -> \"infogrames\")[relation=\"publisher\"], (\"slave zero\" -> \"accolade (developer)\")[relation=\"developer\"], (\"slave zero\" -> \"multi-player video game\")[relation=\"game mode\"], (\"slave zero\" -> \"Leisure software\")[relation=\"instance of\"], (\"slave zero\" -> \"Windows Applications\")[relation=\"platform\"], (\"slave zero\" -> \"CD-ROM\")[relation=\"distribution format\"], (\"Singleplayer video games\" -> \"multi-player video game\")[relation=\"opposite of\"], (\"Singleplayer video games\" -> \"Leisure software\")[relation=\"subclass of\"]];;\\n    head_entity = \"Singleplayer video games\";\\n    tail_entity = \"Leisure software\";\\n}\\n```\\nTask definition: given one head entity and tail entity and corresponding one-hop knowledge sub-graph, classify the relation between head entity and tail entity into one of \"topic\\'s main Wikimedia portal\", \"platform\", \"educated at\", \"opposite of\", \"distribution format\", \"distributor\", \"developer\", \"subclass of\", \"docking port\", \"publisher\", \"instance of\", \"ancestral home\", \"game mode\", \"has effect\", \"genre\", \"significant event\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'infogrames\\', \\'Singleplayer video games\\', \\'multi-player video game\\', \\'CD-ROM\\', \\'Windows Applications\\', \\'Leisure software\\', \\'tommo, inc.\\', \\'slave zero\\', \\'accolade (developer)\\', \\'Action games\\'];\\n    triple_list = [(\"slave zero\" -> \"Action games\")[relation=\"genre\"], (\"slave zero\" -> \"tommo, inc.\")[relation=\"distributor\"], (\"slave zero\" -> \"infogrames\")[relation=\"publisher\"], (\"slave zero\" -> \"accolade (developer)\")[relation=\"developer\"], (\"slave zero\" -> \"multi-player video game\")[relation=\"game mode\"], (\"slave zero\" -> \"Leisure software\")[relation=\"instance of\"], (\"slave zero\" -> \"Windows Applications\")[relation=\"platform\"], (\"slave zero\" -> \"CD-ROM\")[relation=\"distribution format\"], (\"Singleplayer video games\" -> \"multi-player video game\")[relation=\"opposite of\"], (\"Singleplayer video games\" -> \"Leisure software\")[relation=\"subclass of\"]];;\\n    head_entity = \"Singleplayer video games\";\\n    tail_entity = \"Leisure software\";\\n}\\n```', 'graph': {'node_list': ['infogrames', 'Singleplayer video games', 'multi-player video game', 'CD-ROM', 'Windows Applications', 'Leisure software', 'tommo, inc.', 'slave zero', 'accolade (developer)', 'Action games'], 'edge_list': [('slave zero', 'genre', 'Action games'), ('slave zero', 'distributor', 'tommo, inc.'), ('slave zero', 'publisher', 'infogrames'), ('slave zero', 'developer', 'accolade (developer)'), ('slave zero', 'game mode', 'multi-player video game'), ('slave zero', 'instance of', 'Leisure software'), ('slave zero', 'platform', 'Windows Applications'), ('slave zero', 'distribution format', 'CD-ROM'), ('Singleplayer video games', 'opposite of', 'multi-player video game'), ('Singleplayer video games', 'subclass of', 'Leisure software')]}, 'answer': ['game mode'], 'answer_with_cot': ['First, let\\'s analyze the given knowledge sub-graph:\\n- \"slave zero\" is connected to \"Action games\" through the relation \"genre\".\\n- \"slave zero\" is connected to \"tommo, inc.\" through the relation \"distributor\".\\n- \"slave zero\" is connected to \"infogrames\" through the relation \"publisher\".\\n- \"slave zero\" is connected to \"accolade (developer)\" through the relation \"developer\".\\n- \"slave zero\" is connected to \"multi-player video game\" through the relation \"game mode\".\\n- \"slave zero\" is connected to \"Leisure software\" through the relation \"instance of\".\\n- \"slave zero\" is connected to \"Windows Applications\" through the relation \"platform\".\\n- \"slave zero\" is connected to \"CD-ROM\" through the relation \"distribution format\".\\n- \"Singleplayer video games\" is connected to \"multi-player video game\" through the relation \"opposite of\".\\n- \"Singleplayer video games\" is connected to \"Leisure software\" through the relation \"subclass of\".\\n\\nNow, we can classify the relation between the head entity \"Singleplayer video games\" and the tail entity \"Leisure software\" based on the given options:\\n\\n- \"opposite of\": This relation does not exist between \"Singleplayer video games\" and \"Leisure software\" in the knowledge sub-graph.\\n- \"distribution format\": This relation does not exist between \"Singleplayer video games\" and \"Leisure software\" in the knowledge sub-graph.\\n- \"distributor\": This relation does not exist between \"Singleplayer video games\" and \"Leisure software\" in the knowledge sub-graph.\\n- \"developer\": This relation does not exist between \"Singleplayer video games\" and \"Leisure software\" in the knowledge sub-graph.\\n- \"subclass of\": This relation exists between \"Singleplayer video games\" and \"Leisure software\" in the knowledge sub-graph.\\n- \"platform\": This relation does not exist between \"Singleplayer video games\" and \"Leisure software\" in the knowledge sub-graph.\\n- \"instance of\": This relation does not exist between \"Singleplayer video games\" and \"Leisure software\" in the knowledge sub-graph.\\n- \"game mode\": This relation does not exist between \"Singleplayer video games\" and \"Leisure software\" in the knowledge sub-graph.\\n- \"genre\": This relation does not exist between \"Singleplayer video games\" and \"Leisure software\" in the knowledge sub-graph.\\n- \"publisher\": This relation does not exist between \"Singleplayer video games\" and \"Leisure software\" in the knowledge sub-graph.\\n- \"educated at\": This relation does not exist between \"Singleplayer video games\" and \"Leisure software\" in the knowledge sub-graph.\\n- \"topic\\'s main Wikimedia portal\": This relation does not exist between \"Singleplayer video games\" and \"Leisure software\" in the knowledge sub-graph.\\n- \"ancestral home\": This relation does not exist between \"Singleplayer video games\" and \"Leisure software\" in the knowledge sub-graph.\\n- \"has effect\": This relation does not exist between \"Singleplayer video games\" and \"Leisure software\" in the knowledge sub-graph.\\n- \"significant event\": This relation does not exist between \"Singleplayer video games\" and \"Leisure software\" in the knowledge sub-graph.\\n\\nTherefore, based on the given knowledge sub-graph, the relation between \"Singleplayer video games\" and \"Leisure software\" is classified as \"subclass of\".'], 'difficulty': 'medium', 'from': 'Wikidata5M'},\n",
       "       {'task_name': 'graph-language-modeling-graph-relevance-inspection', 'idx': 19049, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikipedia-knowledge-graph\"] {\\n    entity_list = [\\'waikato\\', \\'wairakei\\', \\'wairakei river\\', \\'stream\\', \"new zealand\\'s\", \\'southeast\\', \\'waikato river\\', \\'meet the\\', \\'10 kilometres\\', \\'north island\\', \\'the town\\'];\\n    triple_list = [(\"waikato\" -> \"new zealand\\'s\")[relation=\"country\"], (\"wairakei\" -> \"new zealand\\'s\")[relation=\"country\"], (\"wairakei river\" -> \"waikato river\")[relation=\"mouth of the watercourse\"], (\"wairakei river\" -> \"new zealand\\'s\")[relation=\"country\"], (\"wairakei river\" -> \"waikato\")[relation=\"located in the administrative territorial entity\"], (\"new zealand\\'s\" -> \"waikato\")[relation=\"contains administrative territorial entity\"], (\"waikato river\" -> \"new zealand\\'s\")[relation=\"country\"], (\"north island\" -> \"new zealand\\'s\")[relation=\"country\"]];\\n}\\n```\\nCaption: The Wairakei River or Wairakei Stream is a river of the Waikato Region of New Zealand\\'s North Island. It flows southeast to meet the Waikato River, which it does at the town of Wairakei, 10 kilometres north of Taupo.\\nTask definition: A binary classification task to inspect whether the given caption is relevant to the graph. The classes are \"Relevant\" and \"Irrelevant\". Note that: Irrelevance means that all the information mentioned in the caption cannot be found in the graph.\\nQ: Given you a knowledge graph and a caption, please inspect whether the caption is relevant to the graph. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikipedia-knowledge-graph\"] {\\n    entity_list = [\\'waikato\\', \\'wairakei\\', \\'wairakei river\\', \\'stream\\', \"new zealand\\'s\", \\'southeast\\', \\'waikato river\\', \\'meet the\\', \\'10 kilometres\\', \\'north island\\', \\'the town\\'];\\n    triple_list = [(\"waikato\" -> \"new zealand\\'s\")[relation=\"country\"], (\"wairakei\" -> \"new zealand\\'s\")[relation=\"country\"], (\"wairakei river\" -> \"waikato river\")[relation=\"mouth of the watercourse\"], (\"wairakei river\" -> \"new zealand\\'s\")[relation=\"country\"], (\"wairakei river\" -> \"waikato\")[relation=\"located in the administrative territorial entity\"], (\"new zealand\\'s\" -> \"waikato\")[relation=\"contains administrative territorial entity\"], (\"waikato river\" -> \"new zealand\\'s\")[relation=\"country\"], (\"north island\" -> \"new zealand\\'s\")[relation=\"country\"]];\\n}\\n```', 'graph': {'node_list': ['waikato', 'wairakei', 'wairakei river', 'stream', \"new zealand's\", 'southeast', 'waikato river', 'meet the', '10 kilometres', 'north island', 'the town'], 'edge_list': [['waikato', 'country', \"new zealand's\"], ['wairakei', 'country', \"new zealand's\"], ['wairakei river', 'mouth of the watercourse', 'waikato river'], ['wairakei river', 'country', \"new zealand's\"], ['wairakei river', 'located in the administrative territorial entity', 'waikato'], [\"new zealand's\", 'contains administrative territorial entity', 'waikato'], ['waikato river', 'country', \"new zealand's\"], ['north island', 'country', \"new zealand's\"]]}, 'answer': ['Relevant'], 'answer_with_cot': ['To determine the relevance of the caption to the graph, we need to compare the information mentioned in the caption with the information present in the graph.\\n\\nStep 1: Analyze the caption and identify the key information mentioned:\\n- The Wairakei River or Wairakei Stream is a river of the Waikato Region.\\n- It flows southeast to meet the Waikato River.\\n- It meets the Waikato River at the town of Wairakei, which is 10 kilometres north of Taupo.\\n- The location is in New Zealand\\'s North Island.\\n\\nStep 2: Compare the key information mentioned in the caption with the graph:\\n- The graph mentions entities related to the caption such as \"waikato,\" \"wairakei,\" \"wairakei river,\" and \"waikato river.\"\\n- The caption mentions the flow of the Wairakei River southeast to meet the Waikato River, which is also mentioned in the graph.\\n- The caption mentions that the meeting point is the town of Wairakei, and the graph also mentions the town of Wairakei.\\n- The caption mentions that the location is in New Zealand\\'s North Island, and the graph also mentions that both the Wairakei River and Waikato River are in New Zealand.\\n\\nStep 3: Conclusion:\\nBased on the comparison, all the key information mentioned in the caption can be found in the graph. Therefore, the caption is relevant to the graph.\\n\\nAnswer: Relevant'], 'difficulty': 'simple', 'from': 'GraphCaptionGeneration'},\n",
       "       {'task_name': 'graph-structure-modeling-bipartite-graph-matching-nlgraph', 'idx': 143, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i -> j) means that the applicant i is interested in the job j.\\n```\\nGraph[name=\"job-interest\"] {\\n    applicant_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];\\n    job_list = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19];\\n    interest_mapping_list = [(0 -> 11), (0 -> 13), (0 -> 10), (0 -> 18), (1 -> 10), (1 -> 18), (1 -> 16), (2 -> 13), (2 -> 16), (2 -> 11), (2 -> 12), (2 -> 14), (3 -> 19), (3 -> 15), (3 -> 17), (3 -> 13), (3 -> 10), (3 -> 16), (3 -> 11), (3 -> 14), (4 -> 16), (4 -> 19), (4 -> 17), (5 -> 11), (5 -> 17), (5 -> 19), (6 -> 19), (6 -> 12), (6 -> 16), (6 -> 13), (6 -> 17), (6 -> 14), (6 -> 11), (7 -> 17), (7 -> 13), (8 -> 10), (8 -> 14), (8 -> 19), (8 -> 17), (8 -> 18), (8 -> 16), (9 -> 19), (9 -> 15), (9 -> 12), (9 -> 16)];\\n}\\n```\\nTask definition: based on a job interest graph, to assign a job for each applicant that they are interested in. Each applicant is interested in some of the jobs. Each job can only accept one applicant and a job applicant can be appointed for only one job.\\nQ: Find an assignment of jobs to applicants in such that the maximum number of applicants find the job they are interested in. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"job-interest\"] {\\n    applicant_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];\\n    job_list = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19];\\n    interest_mapping_list = [(0 -> 11), (0 -> 13), (0 -> 10), (0 -> 18), (1 -> 10), (1 -> 18), (1 -> 16), (2 -> 13), (2 -> 16), (2 -> 11), (2 -> 12), (2 -> 14), (3 -> 19), (3 -> 15), (3 -> 17), (3 -> 13), (3 -> 10), (3 -> 16), (3 -> 11), (3 -> 14), (4 -> 16), (4 -> 19), (4 -> 17), (5 -> 11), (5 -> 17), (5 -> 19), (6 -> 19), (6 -> 12), (6 -> 16), (6 -> 13), (6 -> 17), (6 -> 14), (6 -> 11), (7 -> 17), (7 -> 13), (8 -> 10), (8 -> 14), (8 -> 19), (8 -> 17), (8 -> 18), (8 -> 16), (9 -> 19), (9 -> 15), (9 -> 12), (9 -> 16)];\\n}\\n```', 'graph': {'node_list': {'user_node_list': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 'item_node_list': [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]}, 'edge_list': [('0', '11'), ('0', '13'), ('0', '10'), ('0', '18'), ('1', '10'), ('1', '18'), ('1', '16'), ('2', '13'), ('2', '16'), ('2', '11'), ('2', '12'), ('2', '14'), ('3', '19'), ('3', '15'), ('3', '17'), ('3', '13'), ('3', '10'), ('3', '16'), ('3', '11'), ('3', '14'), ('4', '16'), ('4', '19'), ('4', '17'), ('5', '11'), ('5', '17'), ('5', '19'), ('6', '19'), ('6', '12'), ('6', '16'), ('6', '13'), ('6', '17'), ('6', '14'), ('6', '11'), ('7', '17'), ('7', '13'), ('8', '10'), ('8', '14'), ('8', '19'), ('8', '17'), ('8', '18'), ('8', '16'), ('9', '19'), ('9', '15'), ('9', '12'), ('9', '16')]}, 'answer': ['applicant 0: job 18\\napplicant 1: job 10\\napplicant 2: job 13\\napplicant 3: job 19\\napplicant 4: job 16\\napplicant 5: job 11\\napplicant 6: job 12\\napplicant 7: job 17\\napplicant 8: job 14\\napplicant 9: job 15\\n10 applicants can find the job they are interested in.'], 'answer_with_cot': ['First, let\\'s analyze the graph structure and the node information. \\n\\nThe graph has two sets of nodes: \"applicant_list\" and \"job_list\". \\n\\nThe \"applicant_list\" contains 10 nodes numbered from 0 to 9, representing the applicants. \\n\\nThe \"job_list\" contains 10 nodes numbered from 10 to 19, representing the jobs. \\n\\nThe graph also has a list of mappings called \"interest_mapping_list\", which represents the interests of the applicants in the jobs. Each mapping in the list represents an interest relationship between an applicant and a job. For example, (0 -> 11) means that applicant 0 is interested in job 11.\\n\\nNow, let\\'s find an assignment of jobs to applicants in such a way that the maximum number of applicants find the job they are interested in.\\n\\nOne possible approach is to start with an empty assignment and iteratively assign jobs to applicants based on their interests. Here\\'s a step-by-step process:\\n\\n1. Initialize an empty assignment.\\n2. Iterate over each applicant in the \"applicant_list\".\\n3. For each applicant, check their interests in the \"interest_mapping_list\" to find the job they are most interested in.\\n4. If the job is not already assigned to another applicant, assign it to the current applicant in the assignment.\\n5. If the job is already assigned to another applicant, compare the interests of the current applicant and the assigned applicant for that job.\\n   a. If the current applicant has a higher interest, re-assign the job from the assigned applicant to the current applicant in the assignment.\\n   b. If the assigned applicant has a higher interest, leave the job assigned to the assigned applicant and move on to the next job in the applicant\\'s interest list.\\n6. Repeat steps 3-5 until all applicants in the \"applicant_list\" are processed.\\n\\nAfter going through all applicants, the assignment would be such that the maximum number of applicants find the job they are interested in.\\n\\nNote: This is one possible approach to maximize the number of applicants finding the job they are interested in. Depending on the specific constraints and requirements, different algorithms or heuristics can be applied to find alternative optimal assignments.'], 'difficulty': 'hard', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-language-modeling-graph-question-answering-pathquestion', 'idx': 2629, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'louisa_maria_teresa_stuart\\', \\'cancer\\', \\'male\\', \\'alfonso_iv_deste\\', \\'modena\\', \\'francesco_i_deste\\', \\'james_ii_of_england\\', \\'breast_cancer\\', \\'female\\', \\'james_francis_edward_stuart\\', \\'italy\\', \\'laura_martinozzi\\', \\'rinaldo_deste\\', \\'chateau_de_saint_germain_en_laye\\', \\'mary_of_modena\\'];\\n    triple_list = [(\"mary_of_modena\" -> \"cancer\")[relation=\"cause_of_death\"], (\"mary_of_modena\" -> \"breast_cancer\")[relation=\"cause_of_death\"], (\"mary_of_modena\" -> \"chateau_de_saint_germain_en_laye\")[relation=\"place_of_death\"], (\"francesco_i_deste\" -> \"male\")[relation=\"gender\"], (\"francesco_i_deste\" -> \"alfonso_iv_deste\")[relation=\"children\"], (\"francesco_i_deste\" -> \"female\")[relation=\"gender\"], (\"mary_of_modena\" -> \"female\")[relation=\"gender\"], (\"mary_of_modena\" -> \"modena\")[relation=\"place_of_birth\"], (\"mary_of_modena\" -> \"louisa_maria_teresa_stuart\")[relation=\"children\"], (\"mary_of_modena\" -> \"james_francis_edward_stuart\")[relation=\"children\"], (\"francesco_i_deste\" -> \"italy\")[relation=\"nationality\"], (\"mary_of_modena\" -> \"james_ii_of_england\")[relation=\"spouse\"], (\"mary_of_modena\" -> \"alfonso_iv_deste\")[relation=\"parents\"], (\"francesco_i_deste\" -> \"modena\")[relation=\"place_of_birth\"], (\"mary_of_modena\" -> \"laura_martinozzi\")[relation=\"parents\"], (\"francesco_i_deste\" -> \"rinaldo_deste\")[relation=\"children\"], (\"alfonso_iv_deste\" -> \"francesco_i_deste\")[relation=\"parents\"], (\"mary_of_modena\" -> \"modena\")[relation=\"location\"]];\\n}\\n```\\nTask definition: given a question and factual knowledge graph, find an entity and a reasoning path in the graph to answer the question.\\nQ: what is the name of the gender of mom of francesco_i_deste \\'s kid ? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"freebase-knowledge-base\"] {\\n    entity_list = [\\'louisa_maria_teresa_stuart\\', \\'cancer\\', \\'male\\', \\'alfonso_iv_deste\\', \\'modena\\', \\'francesco_i_deste\\', \\'james_ii_of_england\\', \\'breast_cancer\\', \\'female\\', \\'james_francis_edward_stuart\\', \\'italy\\', \\'laura_martinozzi\\', \\'rinaldo_deste\\', \\'chateau_de_saint_germain_en_laye\\', \\'mary_of_modena\\'];\\n    triple_list = [(\"mary_of_modena\" -> \"cancer\")[relation=\"cause_of_death\"], (\"mary_of_modena\" -> \"breast_cancer\")[relation=\"cause_of_death\"], (\"mary_of_modena\" -> \"chateau_de_saint_germain_en_laye\")[relation=\"place_of_death\"], (\"francesco_i_deste\" -> \"male\")[relation=\"gender\"], (\"francesco_i_deste\" -> \"alfonso_iv_deste\")[relation=\"children\"], (\"francesco_i_deste\" -> \"female\")[relation=\"gender\"], (\"mary_of_modena\" -> \"female\")[relation=\"gender\"], (\"mary_of_modena\" -> \"modena\")[relation=\"place_of_birth\"], (\"mary_of_modena\" -> \"louisa_maria_teresa_stuart\")[relation=\"children\"], (\"mary_of_modena\" -> \"james_francis_edward_stuart\")[relation=\"children\"], (\"francesco_i_deste\" -> \"italy\")[relation=\"nationality\"], (\"mary_of_modena\" -> \"james_ii_of_england\")[relation=\"spouse\"], (\"mary_of_modena\" -> \"alfonso_iv_deste\")[relation=\"parents\"], (\"francesco_i_deste\" -> \"modena\")[relation=\"place_of_birth\"], (\"mary_of_modena\" -> \"laura_martinozzi\")[relation=\"parents\"], (\"francesco_i_deste\" -> \"rinaldo_deste\")[relation=\"children\"], (\"alfonso_iv_deste\" -> \"francesco_i_deste\")[relation=\"parents\"], (\"mary_of_modena\" -> \"modena\")[relation=\"location\"]];\\n}\\n```', 'graph': {'node_list': ['louisa_maria_teresa_stuart', 'cancer', 'male', 'alfonso_iv_deste', 'modena', 'francesco_i_deste', 'james_ii_of_england', 'breast_cancer', 'female', 'james_francis_edward_stuart', 'italy', 'laura_martinozzi', 'rinaldo_deste', 'chateau_de_saint_germain_en_laye', 'mary_of_modena'], 'edge_list': [('mary_of_modena', 'cause_of_death', 'cancer'), ('mary_of_modena', 'cause_of_death', 'breast_cancer'), ('mary_of_modena', 'place_of_death', 'chateau_de_saint_germain_en_laye'), ('francesco_i_deste', 'gender', 'male'), ('francesco_i_deste', 'children', 'alfonso_iv_deste'), ('francesco_i_deste', 'gender', 'female'), ('mary_of_modena', 'gender', 'female'), ('mary_of_modena', 'place_of_birth', 'modena'), ('mary_of_modena', 'children', 'louisa_maria_teresa_stuart'), ('mary_of_modena', 'children', 'james_francis_edward_stuart'), ('francesco_i_deste', 'nationality', 'italy'), ('mary_of_modena', 'spouse', 'james_ii_of_england'), ('mary_of_modena', 'parents', 'alfonso_iv_deste'), ('francesco_i_deste', 'place_of_birth', 'modena'), ('mary_of_modena', 'parents', 'laura_martinozzi'), ('francesco_i_deste', 'children', 'rinaldo_deste'), ('alfonso_iv_deste', 'parents', 'francesco_i_deste'), ('mary_of_modena', 'location', 'modena')]}, 'answer': ['male'], 'answer_with_cot': ['To answer the question \"what is the name of the gender of mom of francesco_i_deste\\'s kid?\", we can use the provided knowledge graph. Let\\'s break down the reasoning path step by step:\\n\\n1. The starting entity is \"francesco_i_deste\".\\n2. We need to find the gender of the mom of \"francesco_i_deste\\'s\" kid.\\n3. From the triple_list, we find (\"francesco_i_deste\" -> \"alfonso_iv_deste\")[relation=\"children\"], which means \"francesco_i_deste\" has a kid named \"alfonso_iv_deste\".\\n4. Next, we need to find the mom of \"alfonso_iv_deste\".\\n5. From the triple_list, we find (\"alfonso_iv_deste\" -> \"francesco_i_deste\")[relation=\"parents\"], which means \"alfonso_iv_deste\" has \"francesco_i_deste\" as one of the parents.\\n6. Finally, we need to find the gender of the entity mentioned above.\\n7. From the triple_list, we find (\"francesco_i_deste\" -> \"female\")[relation=\"gender\"], which means the mom of \"alfonso_iv_deste\" is of gender \"female\".\\n\\nTherefore, the name of the gender of the mom of \"francesco_i_deste\\'s\" kid is \"female\".', \"[('francesco_i_deste', 'children', 'alfonso_iv_deste'), ('alfonso_iv_deste', 'parents', 'francesco_i_deste'), ('francesco_i_deste', 'gender', 'male')]\"], 'difficulty': 'simple', 'from': 'PathQuestion'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-wikidata5m', 'idx': 12098, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'Fulbright fellowship\\', \\'united stated\\', \\'sparc europe\\', \\'gerald (first name)\\', \\'University of Maryland, College Park Terrapins\\', \\'Vniversity\\', \\'The Citadel College\\', \\'The Catholic University of America\\', \\'george washington university\\', \\'Huamn\\', \\'virginia commonwealth university medical college campus\\', \\'virginia (usa state)\\', \\'center for research libraries (crl)\\', \\'Academic economist\\', \\'gerald l. gordon\\', \\'fesmitty77/gmu press\\'];\\n    triple_list = [(\"gerald l. gordon\" -> \"Huamn\")[relation=\"instance of\"], (\"gerald l. gordon\" -> \"Fulbright fellowship\")[relation=\"award received\"], (\"gerald l. gordon\" -> \"The Catholic University of America\")[relation=\"educated at\"], (\"gerald l. gordon\" -> \"The Citadel College\")[relation=\"educated at\"], (\"gerald l. gordon\" -> \"george washington university\")[relation=\"educated at\"], (\"gerald l. gordon\" -> \"University of Maryland, College Park Terrapins\")[relation=\"employer\"], (\"gerald l. gordon\" -> \"fesmitty77/gmu press\")[relation=\"employer\"], (\"gerald l. gordon\" -> \"gerald (first name)\")[relation=\"given name\"], (\"gerald l. gordon\" -> \"Academic economist\")[relation=\"occupation\"], (\"virginia commonwealth university medical college campus\" -> \"virginia (usa state)\")[relation=\"located in the administrative territorial entity\"], (\"virginia commonwealth university medical college campus\" -> \"united stated\")[relation=\"country\"], (\"virginia commonwealth university medical college campus\" -> \"Vniversity\")[relation=\"instance of\"], (\"virginia commonwealth university medical college campus\" -> \"sparc europe\")[relation=\"member of\"], (\"virginia commonwealth university medical college campus\" -> \"center for research libraries (crl)\")[relation=\"member of\"]];;\\n    head_entity = \"virginia commonwealth university medical college campus\";\\n    tail_entity = \"center for research libraries (crl)\";\\n}\\n```\\nTask definition: given one head entity and tail entity and corresponding one-hop knowledge sub-graph, classify the relation between head entity and tail entity into one of \"contributing factor of\", \"award received\", \"educated at\", \"interleaves with\", \"occupation\", \"member of\", \"airline hub\", \"league\", \"employer\", \"located in the administrative territorial entity\", \"given name\", \"instance of\", \"country\", \"member of political party\", \"depicts\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'Fulbright fellowship\\', \\'united stated\\', \\'sparc europe\\', \\'gerald (first name)\\', \\'University of Maryland, College Park Terrapins\\', \\'Vniversity\\', \\'The Citadel College\\', \\'The Catholic University of America\\', \\'george washington university\\', \\'Huamn\\', \\'virginia commonwealth university medical college campus\\', \\'virginia (usa state)\\', \\'center for research libraries (crl)\\', \\'Academic economist\\', \\'gerald l. gordon\\', \\'fesmitty77/gmu press\\'];\\n    triple_list = [(\"gerald l. gordon\" -> \"Huamn\")[relation=\"instance of\"], (\"gerald l. gordon\" -> \"Fulbright fellowship\")[relation=\"award received\"], (\"gerald l. gordon\" -> \"The Catholic University of America\")[relation=\"educated at\"], (\"gerald l. gordon\" -> \"The Citadel College\")[relation=\"educated at\"], (\"gerald l. gordon\" -> \"george washington university\")[relation=\"educated at\"], (\"gerald l. gordon\" -> \"University of Maryland, College Park Terrapins\")[relation=\"employer\"], (\"gerald l. gordon\" -> \"fesmitty77/gmu press\")[relation=\"employer\"], (\"gerald l. gordon\" -> \"gerald (first name)\")[relation=\"given name\"], (\"gerald l. gordon\" -> \"Academic economist\")[relation=\"occupation\"], (\"virginia commonwealth university medical college campus\" -> \"virginia (usa state)\")[relation=\"located in the administrative territorial entity\"], (\"virginia commonwealth university medical college campus\" -> \"united stated\")[relation=\"country\"], (\"virginia commonwealth university medical college campus\" -> \"Vniversity\")[relation=\"instance of\"], (\"virginia commonwealth university medical college campus\" -> \"sparc europe\")[relation=\"member of\"], (\"virginia commonwealth university medical college campus\" -> \"center for research libraries (crl)\")[relation=\"member of\"]];;\\n    head_entity = \"virginia commonwealth university medical college campus\";\\n    tail_entity = \"center for research libraries (crl)\";\\n}\\n```', 'graph': {'node_list': ['Fulbright fellowship', 'united stated', 'sparc europe', 'gerald (first name)', 'University of Maryland, College Park Terrapins', 'Vniversity', 'The Citadel College', 'The Catholic University of America', 'george washington university', 'Huamn', 'virginia commonwealth university medical college campus', 'virginia (usa state)', 'center for research libraries (crl)', 'Academic economist', 'gerald l. gordon', 'fesmitty77/gmu press'], 'edge_list': [('gerald l. gordon', 'instance of', 'Huamn'), ('gerald l. gordon', 'award received', 'Fulbright fellowship'), ('gerald l. gordon', 'educated at', 'The Catholic University of America'), ('gerald l. gordon', 'educated at', 'The Citadel College'), ('gerald l. gordon', 'educated at', 'george washington university'), ('gerald l. gordon', 'employer', 'University of Maryland, College Park Terrapins'), ('gerald l. gordon', 'employer', 'fesmitty77/gmu press'), ('gerald l. gordon', 'given name', 'gerald (first name)'), ('gerald l. gordon', 'occupation', 'Academic economist'), ('virginia commonwealth university medical college campus', 'located in the administrative territorial entity', 'virginia (usa state)'), ('virginia commonwealth university medical college campus', 'country', 'united stated'), ('virginia commonwealth university medical college campus', 'instance of', 'Vniversity'), ('virginia commonwealth university medical college campus', 'member of', 'sparc europe'), ('virginia commonwealth university medical college campus', 'member of', 'center for research libraries (crl)')]}, 'answer': ['employer'], 'answer_with_cot': ['Step 1: Understanding the graph structure and node information\\n- The graph consists of a list of entities and a list of triples.\\n- The entities are: \\'Fulbright fellowship\\', \\'united stated\\', \\'sparc europe\\', \\'gerald (first name)\\', \\'University of Maryland, College Park Terrapins\\', \\'Vniversity\\', \\'The Citadel College\\', \\'The Catholic University of America\\', \\'george washington university\\', \\'Huamn\\', \\'virginia commonwealth university medical college campus\\', \\'virginia (usa state)\\', \\'center for research libraries (crl)\\', \\'Academic economist\\', \\'gerald l. gordon\\', \\'fesmitty77/gmu press\\'.\\n- The triples represent relationships between entities. Each triple consists of a head entity, a tail entity, and a relation.\\n- The head entity is \"virginia commonwealth university medical college campus\" and the tail entity is \"center for research libraries (crl)\".\\n\\nStep 2: Analyzing the triples\\n- (\"gerald l. gordon\" -> \"Huamn\")[relation=\"instance of\"]: This triple states that \"gerald l. gordon\" is an instance of \"Huamn\".\\n- (\"gerald l. gordon\" -> \"Fulbright fellowship\")[relation=\"award received\"]: This triple states that \"gerald l. gordon\" received the \"Fulbright fellowship\" award.\\n- (\"gerald l. gordon\" -> \"The Catholic University of America\")[relation=\"educated at\"]: This triple states that \"gerald l. gordon\" was educated at \"The Catholic University of America\".\\n- (\"gerald l. gordon\" -> \"The Citadel College\")[relation=\"educated at\"]: This triple states that \"gerald l. gordon\" was educated at \"The Citadel College\".\\n- (\"gerald l. gordon\" -> \"george washington university\")[relation=\"educated at\"]: This triple states that \"gerald l. gordon\" was educated at \"george washington university\".\\n- (\"gerald l. gordon\" -> \"University of Maryland, College Park Terrapins\")[relation=\"employer\"]: This triple states that \"gerald l. gordon\" is employed by \"University of Maryland, College Park Terrapins\".\\n- (\"gerald l. gordon\" -> \"fesmitty77/gmu press\")[relation=\"employer\"]: This triple states that \"gerald l. gordon\" is employed by \"fesmitty77/gmu press\".\\n- (\"gerald l. gordon\" -> \"gerald (first name)\")[relation=\"given name\"]: This triple states that \"gerald l. gordon\" has the given name \"gerald\".\\n- (\"gerald l. gordon\" -> \"Academic economist\")[relation=\"occupation\"]: This triple states that \"gerald l. gordon\" has the occupation of an \"Academic economist\".\\n- (\"virginia commonwealth university medical college campus\" -> \"virginia (usa state)\")[relation=\"located in the administrative territorial entity\"]: This triple states that \"virginia commonwealth university medical college campus\" is located in the administrative territorial entity of \"virginia (usa state)\".\\n- (\"virginia commonwealth university medical college campus\" -> \"united stated\")[relation=\"country\"]: This triple states that \"virginia commonwealth university medical college campus\" is located in the country \"united stated\".\\n- (\"virginia commonwealth university medical college campus\" -> \"Vniversity\")[relation=\"instance of\"]: This triple states that \"virginia commonwealth university medical college campus\" is an instance of \"Vniversity\".\\n- (\"virginia commonwealth university medical college campus\" -> \"sparc europe\")[relation=\"member of\"]: This triple states that \"virginia commonwealth university medical college campus\" is a member of \"sparc europe\".\\n- (\"virginia commonwealth university medical college campus\" -> \"center for research libraries (crl)\")[relation=\"member of\"]: This triple states that \"virginia commonwealth university medical college campus\" is a member of \"center for research libraries (crl)\".\\n\\nStep 3: Classifying the relation between head entity and tail entity\\nBased on the given sub-graph and available relations, we can classify the relation between the head entity (\"virginia commonwealth university medical college campus\") and the tail entity (\"center for research libraries (crl)\") as \"member of\".'], 'difficulty': 'medium', 'from': 'Wikidata5M'},\n",
       "       {'task_name': 'graph-language-modeling-graph-link-prediction-wikidata5m', 'idx': 838, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'Mountain/Comments\\', \\'Osteroy\\', \\'Voss Municipality\\', \\'🇳🇴\\', \\'History of Hordaland\\', \\'Samnanger Municipality\\', \\'rome time\\', \\'Vaksdal\\', \\'hogafjellet\\', \\'modalen\\', \\'Vik\\'];\\n    triple_list = [(\"hogafjellet\" -> \"Mountain/Comments\")[relation=\"instance of\"], (\"hogafjellet\" -> \"Osteroy\")[relation=\"located in the administrative territorial entity\"], (\"hogafjellet\" -> \"🇳🇴\")[relation=\"country\"], (\"Vaksdal\" -> \"🇳🇴\")[relation=\"country\"], (\"Vaksdal\" -> \"rome time\")[relation=\"located in time zone\"], (\"Vaksdal\" -> \"Osteroy\")[relation=\"shares border with\"], (\"Vaksdal\" -> \"Voss Municipality\")[relation=\"shares border with\"], (\"Vaksdal\" -> \"modalen\")[relation=\"shares border with\"], (\"Vaksdal\" -> \"Vik\")[relation=\"shares border with\"], (\"Vaksdal\" -> \"Samnanger Municipality\")[relation=\"shares border with\"], (\"Vaksdal\" -> \"History of Hordaland\")[relation=\"located in the administrative territorial entity\"]];;\\n    head_entity = \"Vaksdal\";\\n    tail_entity = \"History of Hordaland\";\\n}\\n```\\nTask definition: given one head entity and tail entity and corresponding one-hop knowledge sub-graph, classify the relation between head entity and tail entity into one of \"measured by\", \"killed by\", \"shares border with\", \"located in the administrative territorial entity\", \"designed by\", \"docking port\", \"instance of\", \"based on heuristic\", \"hair color\", \"country\", \"located in time zone\".\\nQ: Please classify the relation between head entity and tail entity. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"wikidata-knowledge-graph\"] {\\n    entity_list = [\\'Mountain/Comments\\', \\'Osteroy\\', \\'Voss Municipality\\', \\'🇳🇴\\', \\'History of Hordaland\\', \\'Samnanger Municipality\\', \\'rome time\\', \\'Vaksdal\\', \\'hogafjellet\\', \\'modalen\\', \\'Vik\\'];\\n    triple_list = [(\"hogafjellet\" -> \"Mountain/Comments\")[relation=\"instance of\"], (\"hogafjellet\" -> \"Osteroy\")[relation=\"located in the administrative territorial entity\"], (\"hogafjellet\" -> \"🇳🇴\")[relation=\"country\"], (\"Vaksdal\" -> \"🇳🇴\")[relation=\"country\"], (\"Vaksdal\" -> \"rome time\")[relation=\"located in time zone\"], (\"Vaksdal\" -> \"Osteroy\")[relation=\"shares border with\"], (\"Vaksdal\" -> \"Voss Municipality\")[relation=\"shares border with\"], (\"Vaksdal\" -> \"modalen\")[relation=\"shares border with\"], (\"Vaksdal\" -> \"Vik\")[relation=\"shares border with\"], (\"Vaksdal\" -> \"Samnanger Municipality\")[relation=\"shares border with\"], (\"Vaksdal\" -> \"History of Hordaland\")[relation=\"located in the administrative territorial entity\"]];;\\n    head_entity = \"Vaksdal\";\\n    tail_entity = \"History of Hordaland\";\\n}\\n```', 'graph': {'node_list': ['Mountain/Comments', 'Osteroy', 'Voss Municipality', '🇳🇴', 'History of Hordaland', 'Samnanger Municipality', 'rome time', 'Vaksdal', 'hogafjellet', 'modalen', 'Vik'], 'edge_list': [('hogafjellet', 'instance of', 'Mountain/Comments'), ('hogafjellet', 'located in the administrative territorial entity', 'Osteroy'), ('hogafjellet', 'country', '🇳🇴'), ('Vaksdal', 'country', '🇳🇴'), ('Vaksdal', 'located in time zone', 'rome time'), ('Vaksdal', 'shares border with', 'Osteroy'), ('Vaksdal', 'shares border with', 'Voss Municipality'), ('Vaksdal', 'shares border with', 'modalen'), ('Vaksdal', 'shares border with', 'Vik'), ('Vaksdal', 'shares border with', 'Samnanger Municipality'), ('Vaksdal', 'located in the administrative territorial entity', 'History of Hordaland')]}, 'answer': ['located in the administrative territorial entity'], 'answer_with_cot': ['To classify the relation between the head entity \"Vaksdal\" and the tail entity \"History of Hordaland,\" we need to analyze the provided sub-graph. The relevant information is as follows:\\n\\n1. \"Vaksdal\" is connected to \"🇳🇴\" with a directed edge labeled \"country\".\\n2. \"Vaksdal\" is connected to \"rome time\" with a directed edge labeled \"located in time zone\".\\n3. \"Vaksdal\" is connected to \"Osteroy\" with a directed edge labeled \"shares border with\".\\n4. \"Vaksdal\" is connected to \"Voss Municipality\" with a directed edge labeled \"shares border with\".\\n5. \"Vaksdal\" is connected to \"modalen\" with a directed edge labeled \"shares border with\".\\n6. \"Vaksdal\" is connected to \"Vik\" with a directed edge labeled \"shares border with\".\\n7. \"Vaksdal\" is connected to \"Samnanger Municipality\" with a directed edge labeled \"shares border with\".\\n8. \"Vaksdal\" is connected to \"History of Hordaland\" with a directed edge labeled \"located in the administrative territorial entity\".\\n\\nFrom the given relation options, we can see that the relation \"shares border with\" is mentioned in multiple edges connecting \"Vaksdal\" with other entities. Therefore, we can classify the relation between \"Vaksdal\" and \"History of Hordaland\" as \"shares border with\".'], 'difficulty': 'medium', 'from': 'Wikidata5M'},\n",
       "       {'task_name': 'graph-structure-modeling-graph-connectivity-detection-nlgraph', 'idx': 1600, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"connectivity-detection\"] {\\n    node_list = [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 23];\\n    edge_list = [(0 <-> 23), (1 <-> 17), (2 <-> 9), (3 <-> 16), (5 <-> 18), (5 <-> 11), (5 <-> 21), (6 <-> 21), (6 <-> 15), (7 <-> 19), (7 <-> 21), (8 <-> 10), (8 <-> 12), (8 <-> 16), (10 <-> 16), (14 <-> 23), (15 <-> 21), (16 <-> 19), (17 <-> 20), (18 <-> 19), (20 <-> 23)];\\n}\\n```\\nTask definition: determine if there is a path between two nodes in the graph.\\nQ: Is there a path between node 17 and node 20? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"connectivity-detection\"] {\\n    node_list = [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 23];\\n    edge_list = [(0 <-> 23), (1 <-> 17), (2 <-> 9), (3 <-> 16), (5 <-> 18), (5 <-> 11), (5 <-> 21), (6 <-> 21), (6 <-> 15), (7 <-> 19), (7 <-> 21), (8 <-> 10), (8 <-> 12), (8 <-> 16), (10 <-> 16), (14 <-> 23), (15 <-> 21), (16 <-> 19), (17 <-> 20), (18 <-> 19), (20 <-> 23)];\\n}\\n```', 'graph': {'node_list': [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 23], 'edge_list': [('0', '23'), ('1', '17'), ('2', '9'), ('3', '16'), ('5', '18'), ('5', '11'), ('5', '21'), ('6', '21'), ('6', '15'), ('7', '19'), ('7', '21'), ('8', '10'), ('8', '12'), ('8', '16'), ('10', '16'), ('14', '23'), ('15', '21'), ('16', '19'), ('17', '20'), ('18', '19'), ('20', '23')]}, 'answer': ['The answer is yes.'], 'answer_with_cot': ['Yes, there is a path between node 17 and node 20. The graph contains the following connections: (17 <-> 20). Therefore, nodes 17 and 20 are directly connected and there is a path between them.'], 'difficulty': 'medium', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-language-modeling-graph-node-cls-pubmed', 'idx': 9658, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"pubmed-scientific-publications-citation-graph\"] {\\n    publication_node_list = [\"paper_19018\", \"paper_3118\"];\\n    publication_node_feature = [\"paper_19018\".category=\"class_1\"];\\n    target_publication_node = \"paper_3118\";\\n    citation_triple_list = [(\"paper_3118\" -> \"paper_19018\")];\\n}\\n```\\nTask definition: given a target scientific publication and corresponding citation graph, classify the target scientific publication into one of three categories, such as \\'class_0\\', \\'class_1\\' and \\'class_2\\'.\\nQ: Please classify the target scientific publication. Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"pubmed-scientific-publications-citation-graph\"] {\\n    publication_node_list = [\"paper_19018\", \"paper_3118\"];\\n    publication_node_feature = [\"paper_19018\".category=\"class_1\"];\\n    target_publication_node = \"paper_3118\";\\n    citation_triple_list = [(\"paper_3118\" -> \"paper_19018\")];\\n}\\n```', 'graph': {'node_list': {19018, 3118}, 'edge_list': {(3118, 19018)}, 'node_feature': {19018: 'class_1'}}, 'answer': ['class_1'], 'answer_with_cot': [\"Based on the provided graph language, the target scientific publication can be classified into the category mentioned in the graph. However, the information about the categories is missing from the given graph language. In order to classify the target scientific publication, we need to know the categories ('class_0', 'class_1', 'class_2') and their corresponding criteria or features.\"], 'difficulty': 'easy', 'from': 'PubMed'},\n",
       "       {'task_name': 'graph-structure-modeling-graph-cycle-detection-nlgraph', 'idx': 574, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"cycle-detection\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27];\\n    edge_list = [(10 <-> 6), (16 <-> 1), (23 <-> 11), (24 <-> 26), (22 <-> 24), (14 <-> 3), (19 <-> 0), (5 <-> 18), (4 <-> 21), (27 <-> 4), (11 <-> 7), (15 <-> 26), (15 <-> 12), (16 <-> 12), (26 <-> 2), (26 <-> 23), (21 <-> 14), (19 <-> 25), (14 <-> 20), (10 <-> 9), (7 <-> 9), (13 <-> 17), (5 <-> 4), (17 <-> 8), (10 <-> 0), (17 <-> 0), (9 <-> 21)];\\n}\\n```\\nTask definition: determine if there is a cycle in this graph.\\nQ: Is there a cycle in this graph? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"cycle-detection\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27];\\n    edge_list = [(10 <-> 6), (16 <-> 1), (23 <-> 11), (24 <-> 26), (22 <-> 24), (14 <-> 3), (19 <-> 0), (5 <-> 18), (4 <-> 21), (27 <-> 4), (11 <-> 7), (15 <-> 26), (15 <-> 12), (16 <-> 12), (26 <-> 2), (26 <-> 23), (21 <-> 14), (19 <-> 25), (14 <-> 20), (10 <-> 9), (7 <-> 9), (13 <-> 17), (5 <-> 4), (17 <-> 8), (10 <-> 0), (17 <-> 0), (9 <-> 21)];\\n}\\n```', 'graph': {'node_list': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27], 'edge_list': [('10', '6'), ('16', '1'), ('23', '11'), ('24', '26'), ('22', '24'), ('14', '3'), ('19', '0'), ('5', '18'), ('4', '21'), ('27', '4'), ('11', '7'), ('15', '26'), ('15', '12'), ('16', '12'), ('26', '2'), ('26', '23'), ('21', '14'), ('19', '25'), ('14', '20'), ('10', '9'), ('7', '9'), ('13', '17'), ('5', '4'), ('17', '8'), ('10', '0'), ('17', '0'), ('9', '21')]}, 'answer': ['No, there is no cycle in this graph.'], 'answer_with_cot': [\"To determine if there is a cycle in this graph, we can use a graph traversal algorithm such as depth-first search (DFS) or breadth-first search (BFS).\\n\\nStarting from any node, we can traverse the graph by following the edges to neighboring nodes. While traversing, we keep track of visited nodes to detect any cycles.\\n\\nLet's perform a DFS starting from node 0:\\n\\n1. Visit node 0.\\n2. Visit its neighboring node 10.\\n3. Visit neighboring node 6.\\n4. Visit neighboring node 9.\\n5. Visit neighboring node 21.\\n6. Visit neighboring node 14.\\n7. Visit neighboring node 3.\\n8. Visit neighboring node 20.\\n9. Visit neighboring node 25.\\n10. Visit neighboring node 19.\\n11. Visit neighboring node 0 (already visited, indicating a cycle).\\n\\nTherefore, there is a cycle in this graph.\"], 'difficulty': 'hard', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-language-modeling-graph-question-answering-wc2014', 'idx': 5400, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"football-worldcup-knowledge-base\"] {\\n    entity_list = [\\'GNK_Dinamo_Zagreb\\', \\'Vincent_ABOUBAKAR\\', \\'Kawasaki_Frontale\\', \\'Russia\\', \\'11\\', \\'Sanfrecce_Hiroshima\\', \\'England\\', \\'17\\', \\'13\\', \\'Lionel_MESSI\\', \\'Jeremain_LENS\\', \\'Edinson_CAVANI\\', \\'FC_Barcelona\\', \\'Dimitrios_SALPINGIDIS\\', \\'Alexis_SANCHEZ\\', \\'14\\', \\'Cerezo_Osaka\\', \\'New_York_Red_Bulls\\', \\'28\\', \\'Kevin_MIRALLAS\\', \\'Aron_JOHANNSSON\\', \\'Mexico\\', \\'Yoichiro_KAKITANI\\', \\'Alexander_KOKORIN\\', \\'9\\', \\'Forward\\', \\'Shusaku_NISHIKAWA\\', \\'Abel_HERNANDEZ\\', \\'Tim_CAHILL\\', \\'JO\\', \\'HWANG_Seokho\\', \\'Urawa_Red_Diamonds\\', \\'Didier_DROGBA\\', \\'France\\', \\'Enner_VALENCIA\\', \\'Danny_WELBECK\\', \\'Yoshito_OKUBO\\', \\'El_Arabi_SOUDANI\\', \\'Salomon_KALOU\\', \\'27\\', \\'Eric_CHOUPO_MOTING\\'];\\n    triple_list = [(\"Abel_HERNANDEZ\" -> \"Forward\")[relation=\"plays_position\"], (\"JO\" -> \"Forward\")[relation=\"plays_position\"], (\"Enner_VALENCIA\" -> \"Mexico\")[relation=\"plays_for_country\"], (\"Eric_CHOUPO_MOTING\" -> \"Forward\")[relation=\"plays_position\"], (\"Kawasaki_Frontale\" -> \"Yoshito_OKUBO\")[relation=\"plays_in_club_inverse\"], (\"Salomon_KALOU\" -> \"France\")[relation=\"plays_for_country\"], (\"Kevin_MIRALLAS\" -> \"England\")[relation=\"plays_for_country\"], (\"Alexis_SANCHEZ\" -> \"FC_Barcelona\")[relation=\"plays_in_club\"], (\"Lionel_MESSI\" -> \"Forward\")[relation=\"plays_position\"], (\"Jeremain_LENS\" -> \"17\")[relation=\"wears_number\"], (\"Didier_DROGBA\" -> \"11\")[relation=\"wears_number\"], (\"Vincent_ABOUBAKAR\" -> \"France\")[relation=\"plays_for_country\"], (\"Danny_WELBECK\" -> \"Forward\")[relation=\"plays_position\"], (\"Yoichiro_KAKITANI\" -> \"11\")[relation=\"wears_number\"], (\"Urawa_Red_Diamonds\" -> \"Shusaku_NISHIKAWA\")[relation=\"plays_in_club_inverse\"], (\"El_Arabi_SOUDANI\" -> \"GNK_Dinamo_Zagreb\")[relation=\"plays_in_club\"], (\"Tim_CAHILL\" -> \"New_York_Red_Bulls\")[relation=\"plays_in_club\"], (\"Alexander_KOKORIN\" -> \"Russia\")[relation=\"plays_for_country\"], (\"Shusaku_NISHIKAWA\" -> \"28\")[relation=\"is_aged\"], (\"Yoichiro_KAKITANI\" -> \"Cerezo_Osaka\")[relation=\"plays_in_club\"], (\"Dimitrios_SALPINGIDIS\" -> \"14\")[relation=\"wears_number\"], (\"Sanfrecce_Hiroshima\" -> \"HWANG_Seokho\")[relation=\"plays_in_club_inverse\"], (\"Yoshito_OKUBO\" -> \"13\")[relation=\"wears_number\"], (\"Edinson_CAVANI\" -> \"27\")[relation=\"is_aged\"], (\"Aron_JOHANNSSON\" -> \"9\")[relation=\"wears_number\"], (\"Enner_VALENCIA\" -> \"13\")[relation=\"wears_number\"]];\\n}\\n```\\nTask definition: given a question and factual knowledge graph, find an entity and a reasoning path in the graph to answer the question.\\nQ: what number does Yoichiro_KAKITANI wear ? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"football-worldcup-knowledge-base\"] {\\n    entity_list = [\\'GNK_Dinamo_Zagreb\\', \\'Vincent_ABOUBAKAR\\', \\'Kawasaki_Frontale\\', \\'Russia\\', \\'11\\', \\'Sanfrecce_Hiroshima\\', \\'England\\', \\'17\\', \\'13\\', \\'Lionel_MESSI\\', \\'Jeremain_LENS\\', \\'Edinson_CAVANI\\', \\'FC_Barcelona\\', \\'Dimitrios_SALPINGIDIS\\', \\'Alexis_SANCHEZ\\', \\'14\\', \\'Cerezo_Osaka\\', \\'New_York_Red_Bulls\\', \\'28\\', \\'Kevin_MIRALLAS\\', \\'Aron_JOHANNSSON\\', \\'Mexico\\', \\'Yoichiro_KAKITANI\\', \\'Alexander_KOKORIN\\', \\'9\\', \\'Forward\\', \\'Shusaku_NISHIKAWA\\', \\'Abel_HERNANDEZ\\', \\'Tim_CAHILL\\', \\'JO\\', \\'HWANG_Seokho\\', \\'Urawa_Red_Diamonds\\', \\'Didier_DROGBA\\', \\'France\\', \\'Enner_VALENCIA\\', \\'Danny_WELBECK\\', \\'Yoshito_OKUBO\\', \\'El_Arabi_SOUDANI\\', \\'Salomon_KALOU\\', \\'27\\', \\'Eric_CHOUPO_MOTING\\'];\\n    triple_list = [(\"Abel_HERNANDEZ\" -> \"Forward\")[relation=\"plays_position\"], (\"JO\" -> \"Forward\")[relation=\"plays_position\"], (\"Enner_VALENCIA\" -> \"Mexico\")[relation=\"plays_for_country\"], (\"Eric_CHOUPO_MOTING\" -> \"Forward\")[relation=\"plays_position\"], (\"Kawasaki_Frontale\" -> \"Yoshito_OKUBO\")[relation=\"plays_in_club_inverse\"], (\"Salomon_KALOU\" -> \"France\")[relation=\"plays_for_country\"], (\"Kevin_MIRALLAS\" -> \"England\")[relation=\"plays_for_country\"], (\"Alexis_SANCHEZ\" -> \"FC_Barcelona\")[relation=\"plays_in_club\"], (\"Lionel_MESSI\" -> \"Forward\")[relation=\"plays_position\"], (\"Jeremain_LENS\" -> \"17\")[relation=\"wears_number\"], (\"Didier_DROGBA\" -> \"11\")[relation=\"wears_number\"], (\"Vincent_ABOUBAKAR\" -> \"France\")[relation=\"plays_for_country\"], (\"Danny_WELBECK\" -> \"Forward\")[relation=\"plays_position\"], (\"Yoichiro_KAKITANI\" -> \"11\")[relation=\"wears_number\"], (\"Urawa_Red_Diamonds\" -> \"Shusaku_NISHIKAWA\")[relation=\"plays_in_club_inverse\"], (\"El_Arabi_SOUDANI\" -> \"GNK_Dinamo_Zagreb\")[relation=\"plays_in_club\"], (\"Tim_CAHILL\" -> \"New_York_Red_Bulls\")[relation=\"plays_in_club\"], (\"Alexander_KOKORIN\" -> \"Russia\")[relation=\"plays_for_country\"], (\"Shusaku_NISHIKAWA\" -> \"28\")[relation=\"is_aged\"], (\"Yoichiro_KAKITANI\" -> \"Cerezo_Osaka\")[relation=\"plays_in_club\"], (\"Dimitrios_SALPINGIDIS\" -> \"14\")[relation=\"wears_number\"], (\"Sanfrecce_Hiroshima\" -> \"HWANG_Seokho\")[relation=\"plays_in_club_inverse\"], (\"Yoshito_OKUBO\" -> \"13\")[relation=\"wears_number\"], (\"Edinson_CAVANI\" -> \"27\")[relation=\"is_aged\"], (\"Aron_JOHANNSSON\" -> \"9\")[relation=\"wears_number\"], (\"Enner_VALENCIA\" -> \"13\")[relation=\"wears_number\"]];\\n}\\n```', 'graph': {'node_list': ['GNK_Dinamo_Zagreb', 'Vincent_ABOUBAKAR', 'Kawasaki_Frontale', 'Russia', '11', 'Sanfrecce_Hiroshima', 'England', '17', '13', 'Lionel_MESSI', 'Jeremain_LENS', 'Edinson_CAVANI', 'FC_Barcelona', 'Dimitrios_SALPINGIDIS', 'Alexis_SANCHEZ', '14', 'Cerezo_Osaka', 'New_York_Red_Bulls', '28', 'Kevin_MIRALLAS', 'Aron_JOHANNSSON', 'Mexico', 'Yoichiro_KAKITANI', 'Alexander_KOKORIN', '9', 'Forward', 'Shusaku_NISHIKAWA', 'Abel_HERNANDEZ', 'Tim_CAHILL', 'JO', 'HWANG_Seokho', 'Urawa_Red_Diamonds', 'Didier_DROGBA', 'France', 'Enner_VALENCIA', 'Danny_WELBECK', 'Yoshito_OKUBO', 'El_Arabi_SOUDANI', 'Salomon_KALOU', '27', 'Eric_CHOUPO_MOTING'], 'edge_list': [('Abel_HERNANDEZ', 'plays_position', 'Forward'), ('JO', 'plays_position', 'Forward'), ('Enner_VALENCIA', 'plays_for_country', 'Mexico'), ('Eric_CHOUPO_MOTING', 'plays_position', 'Forward'), ('Kawasaki_Frontale', 'plays_in_club_inverse', 'Yoshito_OKUBO'), ('Salomon_KALOU', 'plays_for_country', 'France'), ('Kevin_MIRALLAS', 'plays_for_country', 'England'), ('Alexis_SANCHEZ', 'plays_in_club', 'FC_Barcelona'), ('Lionel_MESSI', 'plays_position', 'Forward'), ('Jeremain_LENS', 'wears_number', '17'), ('Didier_DROGBA', 'wears_number', '11'), ('Vincent_ABOUBAKAR', 'plays_for_country', 'France'), ('Danny_WELBECK', 'plays_position', 'Forward'), ('Yoichiro_KAKITANI', 'wears_number', '11'), ('Urawa_Red_Diamonds', 'plays_in_club_inverse', 'Shusaku_NISHIKAWA'), ('El_Arabi_SOUDANI', 'plays_in_club', 'GNK_Dinamo_Zagreb'), ('Tim_CAHILL', 'plays_in_club', 'New_York_Red_Bulls'), ('Alexander_KOKORIN', 'plays_for_country', 'Russia'), ('Shusaku_NISHIKAWA', 'is_aged', '28'), ('Yoichiro_KAKITANI', 'plays_in_club', 'Cerezo_Osaka'), ('Dimitrios_SALPINGIDIS', 'wears_number', '14'), ('Sanfrecce_Hiroshima', 'plays_in_club_inverse', 'HWANG_Seokho'), ('Yoshito_OKUBO', 'wears_number', '13'), ('Edinson_CAVANI', 'is_aged', '27'), ('Aron_JOHANNSSON', 'wears_number', '9'), ('Enner_VALENCIA', 'wears_number', '13')]}, 'answer': ['11'], 'answer_with_cot': ['Yoichiro_KAKITANI wears the number 11. \\nTo reason and find the answer, we follow the path in the graph:\\n1. Yoichiro_KAKITANI -> 11 [wears_number]\\nThus, the reasoning path leads us to the entity \"Yoichiro_KAKITANI\" and the relationship \"wears_number\", which gives us the answer that Yoichiro_KAKITANI wears the number 11.', \"[('Yoichiro_KAKITANI', 'wears_number', '11')]\"], 'difficulty': 'simple', 'from': 'WC2014'},\n",
       "       {'task_name': 'graph-structure-modeling-graph-cycle-detection-nlgraph', 'idx': 133, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"cycle-detection\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];\\n    edge_list = [(6 <-> 0), (8 <-> 9), (5 <-> 1), (4 <-> 8), (3 <-> 2), (9 <-> 6), (6 <-> 2), (5 <-> 3), (7 <-> 4)];\\n}\\n```\\nTask definition: determine if there is a cycle in this graph.\\nQ: Is there a cycle in this graph? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"cycle-detection\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];\\n    edge_list = [(6 <-> 0), (8 <-> 9), (5 <-> 1), (4 <-> 8), (3 <-> 2), (9 <-> 6), (6 <-> 2), (5 <-> 3), (7 <-> 4)];\\n}\\n```', 'graph': {'node_list': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 'edge_list': [('6', '0'), ('8', '9'), ('5', '1'), ('4', '8'), ('3', '2'), ('9', '6'), ('6', '2'), ('5', '3'), ('7', '4')]}, 'answer': ['No, there is no cycle in this graph.'], 'answer_with_cot': [\"To determine if there is a cycle in this graph, we can use a depth-first search (DFS) algorithm. \\n\\nWe start by selecting a node as the starting point and marking it as visited. We then visit all its neighbors. If we encounter a neighbor that has already been visited and is not the parent of the current node, then we have found a cycle. \\n\\nIn this graph, let's start with node 0. We visit its neighbor 6. From 6, we visit its neighbor 2, and then its neighbor 3. From 3, we can visit 2 and then 6 again, completing a cycle (0 -> 6 -> 2 -> 3 -> 6 -> 0). \\n\\nTherefore, there is a cycle in this graph.\"], 'difficulty': 'easy', 'from': 'NLGraph'},\n",
       "       {'task_name': 'graph-structure-modeling-graph-cycle-detection-nlgraph', 'idx': 750, 'instruction': 'You are a good graph reasoner. Give you a graph language that describes a graph structure and node information. You need to understand the graph and the task definition, and answer the question.\\nNote: (i <-> j) means that node i and node j are connected with an undirected edge. (i -> j) means that node i and node j are connected with a directed edge. \\n```\\nGraph[name=\"cycle-detection\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6];\\n    edge_list = [(0 <-> 6), (2 <-> 3), (6 <-> 1), (3 <-> 5), (3 <-> 0), (6 <-> 4)];\\n}\\n```\\nTask definition: determine if there is a cycle in this graph.\\nQ: Is there a cycle in this graph? Let\\'s think step by step. \\nA:', 'graph_language': '```\\nGraph[name=\"cycle-detection\"] {\\n    node_list = [0, 1, 2, 3, 4, 5, 6];\\n    edge_list = [(0 <-> 6), (2 <-> 3), (6 <-> 1), (3 <-> 5), (3 <-> 0), (6 <-> 4)];\\n}\\n```', 'graph': {'node_list': [0, 1, 2, 3, 4, 5, 6], 'edge_list': [('0', '6'), ('2', '3'), ('6', '1'), ('3', '5'), ('3', '0'), ('6', '4')]}, 'answer': ['No, there is no cycle in this graph.'], 'answer_with_cot': ['Yes, there is a cycle in this graph. A cycle is a path in a graph that starts and ends at the same node, and passes through at least one other node. In this graph, we can see that there is a cycle formed by the nodes 0, 6, 1. The edges (0 <-> 6), (6 <-> 1) form this cycle.'], 'difficulty': 'easy', 'from': 'NLGraph'}],\n",
       "      dtype=object)"
      ]
     },
     "execution_count": 110,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "instruction_train_data_with_cot[150:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "39cb21a8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1214.25"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "3238/2/2/23238/5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "d3831b21",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "6010.5599999999995"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(1252.20+1753.08)*2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "d6b20212",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5116.860000000001"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "36549*0.07*2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "00cc05e5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "165.27000000000044"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "36549*0.07 - 2393.16"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "id": "0ad5c941",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1968.203125"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "125965/8/2/2/2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "id": "155e8de0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "33.62347005208333"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "1259650/16/8*3*4.1/3600"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "id": "ea929ba4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "44.831293402777774"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "1259650/8/4*4.1/3600"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "id": "2fb63fcd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "259266"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "554+273+75448+13832+82121+87038"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "d039ff47",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tensor(nan)\n"
     ]
    }
   ],
   "source": [
    "import torch\n",
    "from torch.nn import CrossEntropyLoss\n",
    "shift_logits = torch.randn([3,5])\n",
    "shift_labels = torch.tensor([-100,-100,-100],dtype=torch.int64)\n",
    "loss_fct = CrossEntropyLoss()\n",
    "loss = loss_fct(shift_logits, shift_labels)\n",
    "print(loss)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "04b0be45",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = torch.Tensor([-100, -100, -100])\n",
    "torch.sum((a!=-100).long()).tolist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "8dae02cb-93ec-4a0d-ad7c-fb98e5076ca4",
   "metadata": {},
   "outputs": [],
   "source": [
    "a = \"\"\"2323\\n```\\nGraph[name=\"knowledge-graph\"] {\\n    entity_list = [\"1956 NCAA Track and Field Championships\", \"Berkeley, California\", \"UCLA\", \"University of Southern California\", \"Bobby Morrow\", \"1956 Summer Olympics\", \"Rafer Johnson\", \"1960 Summer Olympics\", \"Arnie Sowell\", \"University of Pittsburgh\", \"June 1956\", \"June 1956\", \"1960\"];\\n    triple_list = [(\"1960 Summer Olympics\" -> \"1960\")[relation=\"occurrence time\"], (\"1956 NCAA Track and Field Championships\" -> \"Berkeley, California\")[relation=\"scene\"], (\"1956 Summer Olympics\" -> \"Arnie Sowell\")[relation=\"participant\"], (\"1956 NCAA Track and Field Championships\" -> \"June 1956\")[relation=\"occurrence time\"], (\"1956 Summer Olympics\" -> \"June 1956\")[relation=\"occurrence time\"]];\\n}\\n```\\newdedwe\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "31eb69f1-8b4a-40c5-8e05-b6d036fa6e2b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2323\n",
      "```\n",
      "Graph[name=\"knowledge-graph\"] {\n",
      "    entity_list = [\"1956 NCAA Track and Field Championships\", \"Berkeley, California\", \"UCLA\", \"University of Southern California\", \"Bobby Morrow\", \"1956 Summer Olympics\", \"Rafer Johnson\", \"1960 Summer Olympics\", \"Arnie Sowell\", \"University of Pittsburgh\", \"June 1956\", \"June 1956\", \"1960\"];\n",
      "    triple_list = [(\"1960 Summer Olympics\" -> \"1960\")[relation=\"occurrence time\"], (\"1956 NCAA Track and Field Championships\" -> \"Berkeley, California\")[relation=\"scene\"], (\"1956 Summer Olympics\" -> \"Arnie Sowell\")[relation=\"participant\"], (\"1956 NCAA Track and Field Championships\" -> \"June 1956\")[relation=\"occurrence time\"], (\"1956 Summer Olympics\" -> \"June 1956\")[relation=\"occurrence time\"]];\n",
      "}\n",
      "```\n",
      "ewdedwe\n"
     ]
    }
   ],
   "source": [
    "print(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "bd39f032-b4c0-4fad-9513-3841703ce3d3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n",
      "6\n"
     ]
    }
   ],
   "source": [
    "lines = a.split(\"\\n\")\n",
    "status = 0\n",
    "start, end = -1, -1\n",
    "for ei, line in enumerate(lines):\n",
    "    if line == \"```\":\n",
    "        if status == 0:\n",
    "            status = 1\n",
    "            start = ei\n",
    "        elif status == 1:\n",
    "            status = 2\n",
    "            end = ei\n",
    "print(start)\n",
    "print(end)\n",
    "gcl = lines[start: end + 1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "d5e278a1-a86e-4934-b7da-76e2183327f7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[('1960 Summer Olympics', 'occurrence time', '1960'), ('1956 NCAA Track and Field Championships', 'scene', 'Berkeley, California'), ('1956 Summer Olympics', 'participant', 'Arnie Sowell'), ('1956 NCAA Track and Field Championships', 'occurrence time', 'June 1956'), ('1956 Summer Olympics', 'occurrence time', 'June 1956')]\n"
     ]
    }
   ],
   "source": [
    "\n",
    "entity_list, triple_list = list(), list()\n",
    "triple_strs = gcl[3][4:].replace(\"triple_list = \", \"\")[:-1]\n",
    "triple_strs = [i.split(\")[relation=\") for i in triple_strs.split(\"], (\")]\n",
    "# print(triple_strs)\n",
    "for triple_str in triple_strs:\n",
    "    entity_str, relation = triple_str\n",
    "    head, tail = entity_str.split(\" -> \")\n",
    "    head = head.replace(\"[(\", \"\")\n",
    "    relation = relation.replace(\"]]\", \"\")\n",
    "    if head[0] == \"\\\"\":\n",
    "        head = head[1:]\n",
    "    if head[-1] == \"\\\"\":\n",
    "        head = head[:-1]\n",
    "    if tail[0] == \"\\\"\":\n",
    "        tail = tail[1:]\n",
    "    if tail[-1] == \"\\\"\":\n",
    "        tail = tail[:-1]\n",
    "    if relation[0] == \"\\\"\":\n",
    "        relation = relation[1:]\n",
    "    if relation[-1] == \"\\\"\":\n",
    "        relation = relation[:-1]\n",
    "    triple_list.append((head, relation, tail))\n",
    "print(triple_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "id": "0cc827c4-9982-407c-8010-86403b4222a1",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[(\"0\" -> \"1\"),(\"0\" -> \"2\")]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "['[(\"0\" -> \"1\"', '\"0\" -> \"2\")]']"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "triple_str = \"edge_list = [(\\\"0\\\" -> \\\"1\\\"),(\\\"0\\\" -> \\\"2\\\")];\"\n",
    "triple_str = triple_str.replace(\"edge_list = \", \"\")[:-1]\n",
    "print(triple_str)\n",
    "triple_str.split(\"),(\")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
